public abstract class I2PTunnelUDPClientBase extends I2PTunnelTask implements Source, Sink
| Modifier and Type | Field and Description |
|---|---|
protected long | _clientIdUnique client identifier |
protected I2PAppContext | _contextThe I2P app context |
(package private) static long | DEFAULT_CONNECT_TIMEOUTDefault connect timeout |
protected Logging | lLogging instance |
open, tunnel| Constructor and Description |
|---|
I2PTunnelUDPClientBase(String destination,
Logging l,
EventDispatcher notifyThis,
I2PTunnel tunnel) |
| Modifier and Type | Method and Description |
|---|---|
boolean | close(boolean forced)Closes the tunnel and destroys the session. |
void | send(Destination to,
int fromPort,
int toPort,
byte[] data)Sends data through the I2P sink to the configured destination. |
void | setSink(Sink s)Sets the receiver of the UDP datagrams from I2P. |
void | start()Starts the I2P source to begin receiving datagrams. |
void | startRunning()Starts the tunnel and begins processing datagrams. |
connected, destroy, disconnected, errorOccurred, getBooleanOption, getId, getSocketManager, getTunnel, isOpen, optionsUpdated, reportAbuse, routerDisconnected, setId, setName, setTunnel, toStringattachEventDispatcher, detachEventDispatcher, getEventDispatcher, getEvents, getEventValue, ignoreEvents, notifyEvent, unIgnoreEvents, waitEventValueprotected long _clientId
protected I2PAppContext _context
static final long DEFAULT_CONNECT_TIMEOUT
protected Logging l
public I2PTunnelUDPClientBase(String destination, Logging l, EventDispatcher notifyThis, I2PTunnel tunnel) throws IllegalArgumentException
IllegalArgumentException - if the I2CP configuration is b0rked so
badly that we cant create a socketManagerpublic boolean close(boolean forced)
close in class I2PTunnelTaskforced - if true, force immediate close without graceful shutdownpublic void send(Destination to, int fromPort, int toPort, byte[] data)
send in interface Sinkto - the destination to send to, ignored if configured for a single destinationfromPort - I2CP source port, 0-65535toPort - I2CP destination port, 0-65535data - the data to sendRuntimeException - if the session is closedpublic void setSink(Sink s)
public void start()
public void startRunning()