public class I2PTunnelRunner extends I2PAppThread implements I2PSocket.SocketErrorListener, LimitOutputStream.DoneCallback
Modifier and Type | Class and Description |
---|---|
static interface |
I2PTunnelRunner.FailCallback
For use in new constructor
|
static interface |
I2PTunnelRunner.SuccessCallback |
I2PThread.OOMEventListener
Thread.State, Thread.UncaughtExceptionHandler
Modifier and Type | Field and Description |
---|---|
protected boolean |
_keepAliveI2P |
protected boolean |
_keepAliveSocket |
protected Log |
_log |
(package private) static int |
MAX_PACKET_SIZE
max bytes streamed in a packet - smaller ones might be filled
up to this size.
|
(package private) static int |
NETWORK_BUFFER_SIZE |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description |
---|
I2PTunnelRunner(Socket s,
I2PSocket i2ps,
Object slock,
byte[] initialI2PData,
byte[] initialSocketData,
List<I2PSocket> sockList)
Deprecated.
use FailCallback constructor
|
I2PTunnelRunner(Socket s,
I2PSocket i2ps,
Object slock,
byte[] initialI2PData,
byte[] initialSocketData,
List<I2PSocket> sockList,
I2PTunnelRunner.FailCallback onFail)
Recommended new constructor.
|
I2PTunnelRunner(Socket s,
I2PSocket i2ps,
Object slock,
byte[] initialI2PData,
byte[] initialSocketData,
List<I2PSocket> sockList,
I2PTunnelRunner.FailCallback onFail,
boolean keepAliveI2P,
boolean keepAliveSocket)
With keepAlive args.
|
I2PTunnelRunner(Socket s,
I2PSocket i2ps,
Object slock,
byte[] initialI2PData,
byte[] initialSocketData,
List<I2PSocket> sockList,
Runnable onTimeout)
Deprecated.
use FailCallback constructor
|
I2PTunnelRunner(Socket s,
I2PSocket i2ps,
Object slock,
byte[] initialI2PData,
List<I2PSocket> sockList)
Deprecated.
use FailCallback constructor
|
I2PTunnelRunner(Socket s,
I2PSocket i2ps,
Object slock,
byte[] initialI2PData,
List<I2PSocket> sockList,
Runnable onTimeout)
Deprecated.
use FailCallback constructor
|
Modifier and Type | Method and Description |
---|---|
protected void |
close(OutputStream out,
InputStream in,
OutputStream i2pout,
InputStream i2pin,
Socket s,
I2PSocket i2ps,
Thread t1,
Thread t2)
Warning - overridden in I2PTunnelHTTPClientRunner.
|
void |
errorOccurred()
Deprecated.
unused
|
(package private) boolean |
getKeepAliveI2P()
Should we keep the I2P socket open when done?
On the client side, only true if the browser and the server side support it.
|
(package private) boolean |
getKeepAliveSocket()
Should we keep the local browser/server socket open when done?
Usually true for client side.
|
long |
getLastActivityOn()
Deprecated.
unused
|
protected InputStream |
getSocketIn() |
protected OutputStream |
getSocketOut() |
long |
getStartedOn()
When this runner started up transferring data
|
boolean |
isFinished()
Deprecated.
unused
|
void |
run() |
void |
setSuccessCallback(I2PTunnelRunner.SuccessCallback sc)
Will be called if we get any data back.
|
void |
streamDone()
The DoneCallback for the I2P socket.
|
addOOMEventThreadListener, fireOOM, removeOOMEventThreadListener
addOOMEventListener, removeOOMEventListener, start
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, stop, stop, suspend, toString, yield
protected final Log _log
static int MAX_PACKET_SIZE
static final int NETWORK_BUFFER_SIZE
protected volatile boolean _keepAliveI2P
protected volatile boolean _keepAliveSocket
@Deprecated public I2PTunnelRunner(Socket s, I2PSocket i2ps, Object slock, byte[] initialI2PData, List<I2PSocket> sockList)
slock
- the socket lock, non-nullinitialI2PData
- may be nullsockList
- may be null. Caller must add i2ps to the list! It will be removed here on completion.
Will synchronize on slock when removing.@Deprecated public I2PTunnelRunner(Socket s, I2PSocket i2ps, Object slock, byte[] initialI2PData, byte[] initialSocketData, List<I2PSocket> sockList)
slock
- the socket lock, non-nullinitialI2PData
- may be nullinitialSocketData
- may be nullsockList
- may be null. Caller must add i2ps to the list! It will be removed here on completion.
Will synchronize on slock when removing.@Deprecated public I2PTunnelRunner(Socket s, I2PSocket i2ps, Object slock, byte[] initialI2PData, List<I2PSocket> sockList, Runnable onTimeout)
slock
- the socket lock, non-nullinitialI2PData
- may be nullsockList
- may be null. Caller must add i2ps to the list! It will be removed here on completion.
Will synchronize on slock when removing.onTimeout
- May be null. If non-null and no data (except initial data) was received,
it will be run before closing s.@Deprecated public I2PTunnelRunner(Socket s, I2PSocket i2ps, Object slock, byte[] initialI2PData, byte[] initialSocketData, List<I2PSocket> sockList, Runnable onTimeout)
slock
- the socket lock, non-nullinitialI2PData
- may be nullinitialSocketData
- may be nullsockList
- may be null. Caller must add i2ps to the list! It will be removed here on completion.
Will synchronize on slock when removing.onTimeout
- May be null. If non-null and no data (except initial data) was received,
it will be run before closing s.public I2PTunnelRunner(Socket s, I2PSocket i2ps, Object slock, byte[] initialI2PData, byte[] initialSocketData, List<I2PSocket> sockList, I2PTunnelRunner.FailCallback onFail)
slock
- the socket lock, non-nullinitialI2PData
- may be nullinitialSocketData
- may be nullsockList
- may be null. Caller must add i2ps to the list! It will be removed here on completion.
Will synchronize on slock when removing.onFail
- May be null. If non-null and no data (except initial data) was received,
it will be run before closing s.public I2PTunnelRunner(Socket s, I2PSocket i2ps, Object slock, byte[] initialI2PData, byte[] initialSocketData, List<I2PSocket> sockList, I2PTunnelRunner.FailCallback onFail, boolean keepAliveI2P, boolean keepAliveSocket)
slock
- the socket lock, non-nullinitialI2PData
- may be nullinitialSocketData
- may be nullsockList
- may be null. Caller must add i2ps to the list! It will be removed here on completion.
Will synchronize on slock when removing.onFail
- May be null. If non-null and no data (except initial data) was received,
it will be run before closing s.keepAliveI2P
- Do not close the I2P socket when done.keepAliveSocket
- Do not close the local socket when done.
For client side only; must be false for server side.
NO data will be forwarded from the socket to the i2psocket other than
initialI2PData if this is true.@Deprecated public boolean isFinished()
@Deprecated public long getLastActivityOn()
public long getStartedOn()
public void setSuccessCallback(I2PTunnelRunner.SuccessCallback sc)
protected InputStream getSocketIn() throws IOException
IOException
protected OutputStream getSocketOut() throws IOException
IOException
boolean getKeepAliveI2P()
boolean getKeepAliveSocket()
public void streamDone()
streamDone
in interface LimitOutputStream.DoneCallback
protected void close(OutputStream out, InputStream in, OutputStream i2pout, InputStream i2pin, Socket s, I2PSocket i2ps, Thread t1, Thread t2) throws InterruptedException
out
- may be nullin
- may be nulli2pout
- may be nulli2pin
- may be nullt1
- may be nullt2
- may be null, ignored, we only join t1InterruptedException
@Deprecated public void errorOccurred()
errorOccurred
in interface I2PSocket.SocketErrorListener