public class I2PTunnelClient extends I2PTunnelClientBase
Listens on a local port and creates I2P connections to configured destinations when clients connect. Supports multiple destinations with random selection, configurable read timeouts, and port mapping for services like SMTP and POP.
Handles destination resolution, connection management, and data forwarding between local client socket and remote I2P destination.
| Modifier and Type | Field and Description |
|---|---|
protected long | readTimeoutIdle timeout in milliseconds for I2P socket reads on new connections. |
_clientId, _context, _executor, _log, _ownDest, DEFAULT_CONNECT_TIMEOUT, dest, l, listenerReady, mySockets, PROP_USE_SSL, sockLock, sockMgr, ssopen, tunnel| Constructor and Description |
|---|
I2PTunnelClient(int localPort,
String destinations,
Logging l,
boolean ownDest,
EventDispatcher notifyThis,
I2PTunnel tunnel,
String pkf)As of 0.9.20 this is fast, and does NOT connect the manager to the router,
or open the local socket. |
| Modifier and Type | Method and Description |
|---|---|
protected void | clientConnectionRun(Socket s)Handles an incoming local socket by selecting a remote destination and forwarding data. |
boolean | close(boolean forced)Overridden to unregister with port mapper |
long | getReadTimeout()Get the read idle timeout for newly-created connections (in
milliseconds). |
void | optionsUpdated(I2PTunnel tunnel)Update the dests then call super. |
void | setReadTimeout(long ms)Set the read idle timeout for newly-created connections (in
milliseconds). |
void | startRunning()Actually start working on incoming connections. |
buildSocketManager, buildSocketManager, buildSocketManager, buildSocketManager, closeSocket, createI2PSocket, createI2PSocket, createI2PSocket, destroy, getDefaultOptions, getDefaultOptions, getListenHost, getLocalPort, getSocketManager, getSocketManager, getSocketManager, killSharedClient, manageConnection, run, verifySocketManagerconnected, disconnected, errorOccurred, getBooleanOption, getId, getTunnel, isOpen, reportAbuse, routerDisconnected, setId, setName, setTunnel, toStringattachEventDispatcher, detachEventDispatcher, getEventDispatcher, getEvents, getEventValue, ignoreEvents, notifyEvent, unIgnoreEvents, waitEventValueprotected long readTimeout
public I2PTunnelClient(int localPort,
String destinations,
Logging l,
boolean ownDest,
EventDispatcher notifyThis,
I2PTunnel tunnel,
String pkf)
throws IllegalArgumentExceptiondestinations - peers we target, comma- or space-separated. Since 0.9.9, each dest may be appended with :portIllegalArgumentException - if the I2PTunnel does not contain
valid config to contact the routerprotected void clientConnectionRun(Socket s)
clientConnectionRun in class I2PTunnelClientBases - the socket to managepublic boolean close(boolean forced)
close in class I2PTunnelClientBasepublic long getReadTimeout()
public void optionsUpdated(I2PTunnel tunnel)
optionsUpdated in class I2PTunnelClientBasepublic void setReadTimeout(long ms)
ms - in mspublic void startRunning()
startRunning in class I2PTunnelClientBase