net.i2p.i2ptunnel
Class I2PTunnelServer
java.lang.Object
net.i2p.i2ptunnel.I2PTunnelTask
net.i2p.i2ptunnel.I2PTunnelServer
- All Implemented Interfaces:
- Runnable, EventDispatcher
- Direct Known Subclasses:
- I2PTunnelHTTPServer, I2PTunnelIRCServer
public class I2PTunnelServer
- extends I2PTunnelTask
- implements Runnable
Constructor Summary |
I2PTunnelServer(InetAddress host,
int port,
File privkey,
String privkeyname,
Logging l,
EventDispatcher notifyThis,
I2PTunnel tunnel)
|
I2PTunnelServer(InetAddress host,
int port,
InputStream privData,
String privkeyname,
Logging l,
EventDispatcher notifyThis,
I2PTunnel tunnel)
|
I2PTunnelServer(InetAddress host,
int port,
String privData,
Logging l,
EventDispatcher notifyThis,
I2PTunnel tunnel)
|
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 |
_log
protected final Log _log
sockMgr
protected I2PSocketManager sockMgr
i2pss
protected I2PServerSocket i2pss
slock
protected final Object slock
remoteHost
protected InetAddress remoteHost
remotePort
protected int remotePort
readTimeout
protected long readTimeout
- default timeout to 3 minutes - override if desired
__serverId
protected static volatile long __serverId
task
protected I2PTunnelTask task
bidir
protected boolean bidir
localPort
protected int localPort
I2PTunnelServer
public I2PTunnelServer(InetAddress host,
int port,
String privData,
Logging l,
EventDispatcher notifyThis,
I2PTunnel tunnel)
- Throws:
IllegalArgumentException
- if the I2CP configuration is b0rked so
badly that we cant create a socketManager
I2PTunnelServer
public I2PTunnelServer(InetAddress host,
int port,
File privkey,
String privkeyname,
Logging l,
EventDispatcher notifyThis,
I2PTunnel tunnel)
- Throws:
IllegalArgumentException
- if the I2CP configuration is b0rked so
badly that we cant create a socketManager
I2PTunnelServer
public I2PTunnelServer(InetAddress host,
int port,
InputStream privData,
String privkeyname,
Logging l,
EventDispatcher notifyThis,
I2PTunnel tunnel)
- Throws:
IllegalArgumentException
- if the I2CP configuration is b0rked so
badly that we cant create a socketManager
startRunning
public void startRunning()
- Start running the I2PTunnelServer.
setReadTimeout
public void setReadTimeout(long ms)
- Set the read idle timeout for newly-created connections (in
milliseconds). After this time expires without data being reached from
the I2P network, the connection itself will be closed.
getReadTimeout
public long getReadTimeout()
- Get the read idle timeout for newly-created connections (in
milliseconds).
- Returns:
- The read timeout used for connections
close
public boolean close(boolean forced)
- Specified by:
close
in class I2PTunnelTask
getHandlerCount
protected int getHandlerCount()
run
public void run()
- If usePool is set, this starts the executor pool.
Then, do the accept() loop, and either
hands each I2P socket to the executor or runs it in-line.
- Specified by:
run
in interface Runnable
shouldUsePool
public boolean shouldUsePool()
blockingHandle
protected void blockingHandle(I2PSocket socket)