SAMv3DatagramSessionclass SAMDatagramSession extends SAMMessageSession
| 修飾子とタイプ | フィールド | 説明 |
|---|---|---|
static int |
DGRAM_SIZE_MAX |
|
protected SAMDatagramReceiver |
recv |
_isOwnSession, _log| 修飾子 | コンストラクタ | 説明 |
|---|---|---|
|
SAMDatagramSession(java.io.InputStream destStream,
java.util.Properties props,
SAMDatagramReceiver recv) |
Create a new SAM DATAGRAM session.
|
protected |
SAMDatagramSession(java.lang.String dest,
java.util.Properties props,
SAMDatagramReceiver recv) |
Create a new SAM DATAGRAM session.
|
protected |
SAMDatagramSession(I2PSession sess,
java.util.Properties props,
int listenPort,
SAMDatagramReceiver recv) |
Create a new SAM DATAGRAM session on an existing I2P session.
|
| 修飾子とタイプ | メソッド | 説明 |
|---|---|---|
protected void |
messageReceived(byte[] msg,
int proto,
int fromPort,
int toPort) |
Handle a new received message
|
boolean |
sendBytes(java.lang.String dest,
byte[] data,
int proto,
int fromPort,
int toPort) |
Send bytes through a SAM DATAGRAM session.
|
boolean |
sendBytes(java.lang.String dest,
byte[] data,
int proto,
int fromPort,
int toPort,
boolean sendLeaseSet,
int sendTags,
int tagThreshold,
int expiration) |
Send bytes through a SAM DATAGRAM 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 DGRAM_SIZE_MAX
protected SAMDatagramReceiver recv
protected SAMDatagramSession(java.lang.String dest,
java.util.Properties props,
SAMDatagramReceiver recv)
throws java.io.IOException,
DataFormatException,
I2PSessionException
dest - Base64-encoded destination (private key)props - Properties to setup the I2P sessionrecv - Object that will receive incoming datajava.io.IOExceptionDataFormatExceptionI2PSessionExceptionpublic SAMDatagramSession(java.io.InputStream destStream,
java.util.Properties props,
SAMDatagramReceiver recv)
throws java.io.IOException,
DataFormatException,
I2PSessionException
destStream - Input stream containing the destination keysprops - Properties to setup the I2P sessionrecv - Object that will receive incoming datajava.io.IOExceptionDataFormatExceptionI2PSessionExceptionprotected SAMDatagramSession(I2PSession sess, java.util.Properties props, int listenPort, SAMDatagramReceiver recv) throws java.io.IOException, DataFormatException, I2PSessionException
props - unused for nowjava.io.IOExceptionDataFormatExceptionI2PSessionExceptionpublic boolean sendBytes(java.lang.String dest,
byte[] data,
int proto,
int fromPort,
int toPort)
throws DataFormatException,
I2PSessionException
sendBytes クラス内 SAMMessageSessiondest - Destinationdata - Bytes to be sentproto - ignored, will always use PROTO_DATAGRAM (17)DataFormatException - on unknown / bad destI2PSessionException - on serious error, probably session closedpublic boolean sendBytes(java.lang.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 クラス内 SAMMessageSessionmsg - Message payloadprotected void shutDown()
SAMMessageSessionshutDown クラス内 SAMMessageSession