|
||||||||||
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.udpTunnel.I2PTunnelUDPClientBase
public abstract class I2PTunnelUDPClientBase
Base client class that sets up an I2P Datagram client destination. The UDP side is not implemented here, as there are at least two possibilities: 1) UDP side is a "server" Example: Streamr Consumer - Configure a destination host and port - External application sends no data - Extending class must have a constructor with host and port arguments 2) UDP side is a client/server Example: SOCKS UDP (DNS requests?) - configure an inbound port and a destination host and port - External application sends and receives data - Extending class must have a constructor with host and 2 port arguments So the implementing class must create a UDPSource and/or UDPSink, and must call setSink().
Field Summary | |
---|---|
protected long |
_clientId
|
protected I2PAppContext |
_context
|
(package private) static long |
DEFAULT_CONNECT_TIMEOUT
|
protected Destination |
dest
|
protected Logging |
l
|
Fields inherited from class net.i2p.i2ptunnel.I2PTunnelTask |
---|
open |
Constructor Summary | |
---|---|
I2PTunnelUDPClientBase(java.lang.String destination,
Logging l,
EventDispatcher notifyThis,
I2PTunnel tunnel)
|
Method Summary | |
---|---|
boolean |
close(boolean forced)
I2PTunnelTask Methods Classes should override to close UDP side as well |
void |
send(Destination to,
byte[] data)
Sink Methods |
void |
setSink(Sink s)
Source Methods Sets the receiver of the UDP datagrams from I2P Subclass must call this after constructor and before start() |
void |
start()
start the source |
void |
startRunning()
Actually start working on outgoing 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 Destination dest
Constructor Detail |
---|
public I2PTunnelUDPClientBase(java.lang.String destination, Logging l, EventDispatcher notifyThis, I2PTunnel tunnel) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
- if the I2CP configuration is b0rked so
badly that we cant create a socketManagerMethod Detail |
---|
public void startRunning()
public boolean close(boolean forced)
close
in class I2PTunnelTask
public void setSink(Sink s)
setSink
in interface Source
public void start()
start
in interface Source
public void send(Destination to, byte[] data)
send
in interface Sink
to
- - ignored if configured for a single destination
(we use the dest specified in the constructor)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |