java.lang.Object
java.lang.Thread
net.i2p.util.I2PThread
net.i2p.util.I2PAppThread
net.i2p.i2ptunnel.InternalSocketRunner
- All Implemented Interfaces:
Runnable
Listens for in-JVM connections on internal socket.
Nested Class Summary
Nested classes/interfaces inherited from class I2PThread
I2PThread.OOMEventListenerModifier and TypeClassDescriptionstatic interfaceListener for out-of-memory events.Nested classes/interfaces inherited from class Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandlerField Summary
FieldsModifier and TypeFieldDescriptionprivate final I2PTunnelClientBaseThe tunnel client the socket serves.private final StringName shown in the logs for this tunnel.private booleanFalse once the socket has been closed.private final intThe local port being listened on.private ServerSocketThe listening socket, null once closed.Fields inherited from class Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITYConstructor Summary
ConstructorsConstructorDescriptionDoes not start the runner, caller must call start().InternalSocketRunner(I2PTunnelClientBase client, String label) Does not start the runner, caller must call start().Method Summary
Public MethodsModifier and TypeMethodDescriptionfinal voidrun()Accepts internal sockets in a loop until closed, handing each to the tunnel client.(package private) voidStop the server socket and mark as closed.Methods inherited from class I2PAppThread
addOOMEventThreadListener, fireOOM, removeOOMEventThreadListenerModifier and TypeMethodDescriptionvoidRegister a new component that wants notification of OOM events.protected voidfireOOM(OutOfMemoryError oom) Notify listeners that an OutOfMemoryError occurred.voidUnregister a component that wants notification of OOM events.Methods inherited from class I2PThread
addOOMEventListener, removeOOMEventListener, startModifier and TypeMethodDescriptionstatic voidRegister a new component that wants notification of OOM events.static voidUnregister a component that wants notification of OOM events.voidstart()Overridden to provide useful info to users on OOM, and to prevent shutting down the whole JVM for what is most likely not a heap issue.Methods inherited from class Thread
activeCount, clone, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, isVirtual, join, join, join, join, ofPlatform, ofVirtual, onSpinWait, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, sleep, startVirtualThread, threadId, toString, yield
Field Details
client
The tunnel client the socket serves.port
private final int portThe local port being listened on.label
Name shown in the logs for this tunnel.ss
The listening socket, null once closed.open
private volatile boolean openFalse once the socket has been closed.
Constructor Details
InternalSocketRunner
InternalSocketRunner(I2PTunnelClientBase client) Does not start the runner, caller must call start().- Parameters:
client- the tunnel client that handles each socket accepted internally
InternalSocketRunner
InternalSocketRunner(I2PTunnelClientBase client, String label) Does not start the runner, caller must call start().- Parameters:
client- the tunnel client that handles each socket accepted internallylabel- service name shown for this port on the debug page
Method Details
run
stopRunning
void stopRunning()Stop the server socket and mark as closed.