Closeable, AutoCloseable, SAMMessageSessSAMv3RawSessionclass SAMRawSession extends SAMMessageSession
| Modifier and Type | Field | Description |
|---|---|---|
static int |
RAW_SIZE_MAX |
|
protected SAMRawReceiver |
recv |
_isOwnSession, _log| Modifier | Constructor | Description |
|---|---|---|
|
SAMRawSession(InputStream destStream,
Properties props,
SAMRawReceiver recv) |
Create a new SAM RAW session.
|
protected |
SAMRawSession(String dest,
Properties props,
SAMRawReceiver recv) |
Create a new SAM RAW session.
|
protected |
SAMRawSession(I2PSession sess,
Properties props,
int listenProtocol,
int listenPort,
SAMRawReceiver recv) |
Create a new SAM RAW session on an existing I2P session.
|
| Modifier and Type | Method | Description |
|---|---|---|
protected void |
messageReceived(byte[] msg,
int proto,
int fromPort,
int toPort) |
Handle a new received message
|
boolean |
sendBytes(String dest,
byte[] data,
int proto,
int fromPort,
int toPort) |
Send bytes through a SAM RAW session.
|
boolean |
sendBytes(String dest,
byte[] data,
int proto,
int fromPort,
int toPort,
boolean sendLeaseSet,
int sendTags,
int tagThreshold,
int expiration) |
Send bytes through a SAM RAW session.
|
protected void |
shutDown() |
Do whatever is needed to shutdown the SAM session
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclose, getDestination, getI2PSession, getListenPort, getListenProtocol, sendBytesThroughMessageSession, sendBytesThroughMessageSession, startpublic static final int RAW_SIZE_MAX
protected SAMRawReceiver recv
protected SAMRawSession(String dest, Properties props, SAMRawReceiver recv) throws IOException, DataFormatException, I2PSessionException
dest - Base64-encoded destination and private keys (same format as PrivateKeyFile)props - Properties to setup the I2P sessionrecv - Object that will receive incoming dataIOExceptionDataFormatExceptionI2PSessionExceptionpublic SAMRawSession(InputStream destStream, Properties props, SAMRawReceiver recv) throws IOException, DataFormatException, I2PSessionException
destStream - Input stream containing the destination and private keys (same format as PrivateKeyFile)props - Properties to setup the I2P sessionrecv - Object that will receive incoming dataIOExceptionDataFormatExceptionI2PSessionExceptionprotected SAMRawSession(I2PSession sess, Properties props, int listenProtocol, int listenPort, SAMRawReceiver recv) throws IOException, DataFormatException, I2PSessionException
props - unused for nowIOExceptionDataFormatExceptionI2PSessionExceptionpublic boolean sendBytes(String dest, byte[] data, int proto, int fromPort, int toPort) throws DataFormatException, I2PSessionException
sendBytes in interface SAMMessageSesssendBytes in class SAMMessageSessiondata - Bytes to be sentproto - if 0, will use PROTO_DATAGRAM_RAW (18)dest - DestinationDataFormatException - on unknown / bad destI2PSessionException - on serious error, probably session closedpublic boolean sendBytes(String dest, byte[] data, int proto, int fromPort, int toPort, boolean sendLeaseSet, int sendTags, int tagThreshold, int expiration) throws DataFormatException, I2PSessionException
DataFormatExceptionI2PSessionExceptionprotected void messageReceived(byte[] msg,
int proto,
int fromPort,
int toPort)
SAMMessageSessionmessageReceived in class SAMMessageSessionmsg - Message payloadprotected void shutDown()
SAMMessageSessionshutDown in class SAMMessageSession