|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.i2ptunnel.I2PTunnelTask
net.i2p.i2ptunnel.I2PTunnelClientBase
public abstract class I2PTunnelClientBase
Field Summary | |
---|---|
protected long |
_clientId
|
protected I2PAppContext |
_context
|
(package private) static long |
DEFAULT_CONNECT_TIMEOUT
|
protected Destination |
dest
|
protected Logging |
l
|
protected java.util.List |
mySockets
|
static java.lang.String |
PROP_MAX_WAIT_TIME
How long will we let a socket wait after being accept()ed without getting pumped through a connection builder (in milliseconds). |
static java.lang.String |
PROP_NUM_CONNECTION_BUILDERS
How many concurrent connections this I2PTunnel instance will allow to be in the process of connecting (or if less than 1, there is no limit)? |
protected java.lang.Object |
sockLock
|
protected I2PSocketManager |
sockMgr
|
Fields inherited from class net.i2p.i2ptunnel.I2PTunnelTask |
---|
open |
Constructor Summary | |
---|---|
I2PTunnelClientBase(int localPort,
boolean ownDest,
Logging l,
EventDispatcher notifyThis,
java.lang.String handlerName,
I2PTunnel tunnel)
|
Method Summary | |
---|---|
protected I2PSocketManager |
buildSocketManager()
|
protected static I2PSocketManager |
buildSocketManager(I2PTunnel tunnel)
|
protected abstract void |
clientConnectionRun(java.net.Socket s)
Manage a connection in a separate thread. |
boolean |
close(boolean forced)
|
static void |
closeSocket(java.net.Socket s)
|
I2PSocket |
createI2PSocket(Destination dest)
Create a new I2PSocket towards to the specified destination, adding it to the list of connections actually managed by this tunnel. |
I2PSocket |
createI2PSocket(Destination dest,
I2PSocketOptions opt)
Create a new I2PSocket towards to the specified destination, adding it to the list of connections actually managed by this tunnel. |
protected I2PSocketOptions |
getDefaultOptions()
create the default options (using the default timeout, etc) |
protected I2PSocketOptions |
getDefaultOptions(java.util.Properties overrides)
create the default options (using the default timeout, etc) |
protected java.net.InetAddress |
getListenHost(Logging l)
|
int |
getLocalPort()
|
protected I2PSocketManager |
getSocketManager()
|
protected static I2PSocketManager |
getSocketManager(I2PTunnel tunnel)
|
protected void |
manageConnection(java.net.Socket s)
Manage the connection just opened on the specified socket |
void |
run()
|
void |
startRunning()
Actually start working on incoming connections. |
Methods inherited from class net.i2p.i2ptunnel.I2PTunnelTask |
---|
attachEventDispatcher, detachEventDispatcher, disconnected, errorOccurred, getEventDispatcher, getEvents, getEventValue, getId, getTunnel, ignoreEvents, isOpen, notifyEvent, reportAbuse, routerDisconnected, setId, setName, setTunnel, toString, unIgnoreEvents, waitEventValue |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected I2PAppContext _context
protected Logging l
static final long DEFAULT_CONNECT_TIMEOUT
protected long _clientId
protected java.lang.Object sockLock
protected I2PSocketManager sockMgr
protected java.util.List mySockets
protected Destination dest
public static final java.lang.String PROP_NUM_CONNECTION_BUILDERS
public static final java.lang.String PROP_MAX_WAIT_TIME
Constructor Detail |
---|
public I2PTunnelClientBase(int localPort, boolean ownDest, Logging l, EventDispatcher notifyThis, java.lang.String handlerName, I2PTunnel tunnel) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
- if the I2CP configuration is b0rked so
badly that we cant create a socketManagerMethod Detail |
---|
protected I2PSocketManager getSocketManager()
protected static I2PSocketManager getSocketManager(I2PTunnel tunnel)
protected I2PSocketManager buildSocketManager()
protected static I2PSocketManager buildSocketManager(I2PTunnel tunnel)
public final int getLocalPort()
protected final java.net.InetAddress getListenHost(Logging l)
public final void startRunning()
protected I2PSocketOptions getDefaultOptions()
protected I2PSocketOptions getDefaultOptions(java.util.Properties overrides)
public I2PSocket createI2PSocket(Destination dest) throws I2PException, java.net.ConnectException, java.net.NoRouteToHostException, java.io.InterruptedIOException
dest
- The destination to connect to
I2PException
java.net.ConnectException
java.net.NoRouteToHostException
java.io.InterruptedIOException
public I2PSocket createI2PSocket(Destination dest, I2PSocketOptions opt) throws I2PException, java.net.ConnectException, java.net.NoRouteToHostException, java.io.InterruptedIOException
dest
- The destination to connect toopt
- Option to be used to open when opening the socket
java.net.ConnectException
- if the peer refuses the connection
java.net.NoRouteToHostException
- if the peer is not found or not reachable
java.io.InterruptedIOException
- if the connection timeouts
I2PException
- if there is some other I2P-related problempublic final void run()
run
in interface java.lang.Runnable
protected void manageConnection(java.net.Socket s)
s
- Socket to take care ofpublic boolean close(boolean forced)
close
in class I2PTunnelTask
public static void closeSocket(java.net.Socket s)
protected abstract void clientConnectionRun(java.net.Socket s)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |