SAMv3RawSession
class SAMRawSession extends SAMMessageSession
修飾子とタイプ | フィールド | 説明 |
---|---|---|
static int |
RAW_SIZE_MAX |
|
protected SAMRawReceiver |
recv |
_isOwnSession, _log
修飾子 | コンストラクタ | 説明 |
---|---|---|
|
SAMRawSession(java.io.InputStream destStream,
java.util.Properties props,
SAMRawReceiver recv) |
Create a new SAM RAW session.
|
protected |
SAMRawSession(java.lang.String dest,
java.util.Properties props,
SAMRawReceiver recv) |
Create a new SAM RAW session.
|
protected |
SAMRawSession(I2PSession sess,
java.util.Properties props,
int listenProtocol,
int listenPort,
SAMRawReceiver recv) |
Create a new SAM RAW 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 RAW 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 RAW session.
|
protected void |
shutDown() |
Do whatever is needed to shutdown the SAM session
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, getDestination, getI2PSession, getListenPort, getListenProtocol, sendBytesThroughMessageSession, sendBytesThroughMessageSession, start
public static final int RAW_SIZE_MAX
protected SAMRawReceiver recv
protected SAMRawSession(java.lang.String dest, java.util.Properties props, SAMRawReceiver recv) throws java.io.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 datajava.io.IOException
DataFormatException
I2PSessionException
public SAMRawSession(java.io.InputStream destStream, java.util.Properties props, SAMRawReceiver recv) throws java.io.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 datajava.io.IOException
DataFormatException
I2PSessionException
protected SAMRawSession(I2PSession sess, java.util.Properties props, int listenProtocol, int listenPort, SAMRawReceiver recv) throws java.io.IOException, DataFormatException, I2PSessionException
props
- unused for nowjava.io.IOException
DataFormatException
I2PSessionException
public boolean sendBytes(java.lang.String dest, byte[] data, int proto, int fromPort, int toPort) throws DataFormatException, I2PSessionException
sendBytes
クラス内 SAMMessageSession
data
- 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(java.lang.String dest, byte[] data, int proto, int fromPort, int toPort, boolean sendLeaseSet, int sendTags, int tagThreshold, int expiration) throws DataFormatException, I2PSessionException
DataFormatException
I2PSessionException
protected void messageReceived(byte[] msg, int proto, int fromPort, int toPort)
SAMMessageSession
messageReceived
クラス内 SAMMessageSession
msg
- Message payloadprotected void shutDown()
SAMMessageSession
shutDown
クラス内 SAMMessageSession