Package net.i2p.router.transport.crypto
Class DHSessionKeyBuilder.PrecalcRunner
java.lang.Object
java.lang.Thread
net.i2p.util.I2PThread
net.i2p.router.transport.crypto.DHSessionKeyBuilder.PrecalcRunner
- All Implemented Interfaces:
Runnable
,DHSessionKeyBuilder.Factory
- Enclosing class:
DHSessionKeyBuilder
public static class DHSessionKeyBuilder.PrecalcRunner
extends I2PThread
implements DHSessionKeyBuilder.Factory
Try to keep DH pairs at the ready.
It's important to do this in a separate thread, because if we run out,
the pairs are generated in the NTCP Pumper thread,
and it can fall behind.
-
Nested Class Summary
Nested classes/interfaces inherited from class net.i2p.util.I2PThread
I2PThread.OOMEventListener
Nested classes/interfaces inherited from class java.lang.Thread
Thread.BuilderPREVIEW, Thread.State, Thread.UncaughtExceptionHandler
-
Field Summary
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionConstruct a new DH key builder or pulls a prebuilt one from the queue.void
returnUnused
(DHSessionKeyBuilder builder) Return an unused DH key builder to be put back onto the queue for reuse.void
run()
void
shutdown()
Note that this stops the singleton precalc thread.Methods inherited from class net.i2p.util.I2PThread
addOOMEventListener, fireOOM, removeOOMEventListener, start
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, isVirtual, join, join, join, join, ofPlatform, ofVirtual, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, sleep, startVirtualThread, stop, suspend, threadId, toString, yield
-
Constructor Details
-
PrecalcRunner
-
-
Method Details
-
shutdown
public void shutdown()Note that this stops the singleton precalc thread. You don't want to do this if there are multiple routers in the JVM. Fix this if you care. See Router.shutdown().- Since:
- 0.8.8
-
run
public void run() -
getBuilder
Construct a new DH key builder or pulls a prebuilt one from the queue.- Specified by:
getBuilder
in interfaceDHSessionKeyBuilder.Factory
- Since:
- 0.9 moved from DHSKB
-
returnUnused
Return an unused DH key builder to be put back onto the queue for reuse.- Specified by:
returnUnused
in interfaceDHSessionKeyBuilder.Factory
- Parameters:
builder
- must not have a peerPublicValue set- Since:
- 0.9.16
-