java.lang.Object
java.lang.Thread
net.i2p.util.I2PThread
net.i2p.util.I2PAppThread
net.i2p.i2ptunnel.I2PTunnelRunner
net.i2p.i2ptunnel.irc.I2PTunnelDCCClient.Runner
- All Implemented Interfaces:
Runnable, LimitOutputStream.DoneCallback
- Enclosing class:
I2PTunnelDCCClient
Just so we can do the callbacks.
Nested Class Summary
Nested classes/interfaces inherited from class I2PTunnelRunner
I2PTunnelRunner.BodyProgress, I2PTunnelRunner.FailCallback, I2PTunnelRunner.ReconnectCallback, I2PTunnelRunner.SuccessCallbackModifier and TypeClassDescriptionprotected static final classSnapshot of body-delivery progress used byI2PTunnelRunner.shouldResumeIncompleteBody(long, long, boolean, boolean, boolean).static interfaceFor use in new constructor.static interfaceCallback for reconnecting via a second route when the first attempt completes with zero upstream bytes, or dies mid-body with an incomplete Content-Length response (Range resume).static interfaceCallback interface for successful tunnel operation completion.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
Fields inherited from class I2PTunnelRunner
_keepAliveI2P, _keepAliveSocket, _logModifier and TypeFieldDescriptionprotected booleanKeep I2P socket alive after data transfer.protected booleanKeep local socket alive after data transfer.protected final LogThe runner's logger, from the global context's log manager.Fields inherited from class Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITYConstructor Summary
Method Summary
All MethodsModifier and TypeMethodDescriptionvoidrun()Brackets the superclass transfer with connect start/stop events and extends the inbound expiry on either side.Methods inherited from class I2PTunnelRunner
close, getBodyProgress, getSocketIn, getSocketOut, getStartedOn, hasTransientResumeFailure, onNoDataFailure, onNoDataFailure, prepareBodyResume, setExecutor, setReconnectCallback, setSuccessCallback, streamDone, trackInitialResponseDeadline, wasTransientResumeFailureModifier and TypeMethodDescriptionprotected voidclose(OutputStream out, InputStream in, OutputStream i2pout, InputStream i2pin, Socket s, I2PSocket i2ps, Thread t1, Thread t2) Warning - overridden inI2PTunnelHTTPClientRunner.protected I2PTunnelRunner.BodyProgressEntity-body progress for a mid-body Range resume.protected InputStreamGets the TCP socket input stream.protected OutputStreamGets the TCP socket output stream.longReturns the timestamp when this runner started.protected booleanWhether a transient status (408/502/503/504) is currently latched on the response stream — observed without clearing, unlikeI2PTunnelRunner.wasTransientResumeFailure().protected voidInvoke the no-data failure callback when a transfer completes (or aborts) without delivering any bytes from the I2P peer.protected voidInvoke the no-data failure callback with an optional cause.protected voidPrepare the HTTP response stream to swallow the next header block (mid-body Range resume).voidsetExecutor(Executor exec) Set the executor for submitting forwarder tasks.voidSet the reconnect callback used for the empty-response retry.voidSets a callback to be invoked on successful data transfer.voidThe DoneCallback for the I2P socket.protected booleanWhether this runner type arms the first-response deadline watchdog.protected booleanWhether the last body-resume attempt failed with a transient status (408/502/503/504) rather than a real stall.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
Constructor Details
Runner
Method Details
run
public void run()Brackets the superclass transfer with connect start/stop events and extends the inbound expiry on either side.- Specified by:
runin interfaceRunnable- Overrides:
runin classI2PTunnelRunner