public class I2PSink extends Object implements Sink
Supports both repliable and raw datagram modes. When not in raw mode,
data is wrapped with I2PDatagramMaker before sending.
| Modifier and Type | Field and Description |
|---|---|
protected Destination | dest |
protected I2PDatagramMaker | maker |
protected boolean | raw |
protected I2PSession | sess |
protected int | toPort |
| Constructor and Description |
|---|
I2PSink(I2PSession sess,
Destination dest)Creates a repliable (non-raw) sink for the given session and destination. |
I2PSink(I2PSession sess,
Destination dest,
boolean raw)Creates a sink for the given session and destination. |
I2PSink(I2PSession sess,
Destination dest,
boolean raw,
int toPort)Creates a sink for the given session, destination, and port. |
| Modifier and Type | Method and Description |
|---|---|
void | send(Destination src,
int fromPort,
int ign_toPort,
byte[] data)Sends data to the fixed destination configured in the constructor. |
protected final Destination dest
protected final I2PDatagramMaker maker
protected final boolean raw
protected final I2PSession sess
protected final int toPort
public I2PSink(I2PSession sess, Destination dest)
sess - the I2P session to send throughdest - the fixed destination to send topublic I2PSink(I2PSession sess, Destination dest, boolean raw)
sess - the I2P session to send throughdest - the fixed destination to send toraw - true for raw datagrams, false for repliablepublic I2PSink(I2PSession sess, Destination dest, boolean raw, int toPort)
sess - the I2P session to send throughdest - the fixed destination to send toraw - true for raw datagrams, false for repliabletoPort - I2CP destination port, 0-65535public void send(Destination src, int fromPort, int ign_toPort, byte[] data)
send in interface Sinksrc - ignoredfromPort - I2CP source port, 0-65535ign_toPort - ignoreddata - the data to sendRuntimeException - if the session is closed