|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
net.i2p.util.I2PThread
net.i2p.util.I2PAppThread
net.i2p.i2ptunnel.I2PTunnelRunner
public class I2PTunnelRunner
A thread that starts two more threads, one to forward traffic in each direction. Warning - not maintained as a stable API for external use.
Nested Class Summary | |
---|---|
static interface |
I2PTunnelRunner.FailCallback
For use in new constructor |
Nested classes/interfaces inherited from class net.i2p.util.I2PThread |
---|
I2PThread.OOMEventListener |
Nested classes/interfaces inherited from class java.lang.Thread |
---|
Thread.State, Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
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
|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
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,
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 |
Method Summary | |
---|---|
protected void |
close(OutputStream out,
InputStream in,
OutputStream i2pout,
InputStream i2pin,
Socket s,
I2PSocket i2ps,
Thread t1,
Thread t2)
|
void |
errorOccurred()
Deprecated, unimplemented in streaming, never called. |
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()
|
Methods inherited from class net.i2p.util.I2PAppThread |
---|
addOOMEventThreadListener, fireOOM, removeOOMEventThreadListener |
Methods inherited from class net.i2p.util.I2PThread |
---|
addOOMEventListener, removeOOMEventListener, start |
Methods inherited from class java.lang.Thread |
---|
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 |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final Log _log
static int MAX_PACKET_SIZE
static final int NETWORK_BUFFER_SIZE
Constructor Detail |
---|
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.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.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.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.Method Detail |
---|
public boolean isFinished()
public long getLastActivityOn()
public long getStartedOn()
protected InputStream getSocketIn() throws IOException
IOException
protected OutputStream getSocketOut() throws IOException
IOException
public void run()
run
in interface Runnable
run
in class I2PThread
protected void close(OutputStream out, InputStream in, OutputStream i2pout, InputStream i2pin, Socket s, I2PSocket i2ps, Thread t1, Thread t2) throws InterruptedException
InterruptedException
public void errorOccurred()
errorOccurred
in interface I2PSocket.SocketErrorListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |