class SAMv2Handler extends SAMv1Handler implements SAMRawReceiver, SAMDatagramReceiver, SAMStreamReceiver
_id, datagramSession, rawSession, SESSION_ERROR, streamSession_log, bridge, i2cpProps, socket, stopHandler, stopLock, thread, verMajor, verMinor| Constructor and Description |
|---|
SAMv2Handler(SocketChannel s,
int verMajor,
int verMinor,
Properties i2cpProps,
SAMBridge parent)Create a new SAM version 2 handler. |
SAMv2Handler(SocketChannel s,
int verMajor,
int verMinor,
SAMBridge parent)Create a new SAM version 2 handler with default I2CP properties. |
| Modifier and Type | Method and Description |
|---|---|
protected boolean | execStreamMessage(String opcode,
Properties props)Parse and execute a STREAM message. |
(package private) SAMStreamSession | newSAMv2StreamSession(String destKeystream,
String direction,
Properties props)New SAMv2 stream session. |
boolean | verifVersion()Verify the SAM protocol version is supported by this handler. |
createMessageString, execDatagramMessage, execDestMessage, execNamingMessage, execRawMessage, execSessionMessage, execStreamClose, execStreamConnect, execStreamSend, getDatagramSession, getRawSession, getStreamSession, handle, notifyStreamDisconnection, notifyStreamIncomingConnection, notifyStreamOutgoingConnection, notifyStreamSendBufferFree, receiveDatagramBytes, receiveRawBytes, receiveStreamBytes, stopDatagramReceiving, stopRawReceiving, stopStreamReceiving, streamSendAnswer, writeStringcloseClientSocket, getClientSocket, getWriteLock, run, shouldStop, startHandling, stopHandling, toString, writeBytes, writeString, writeStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitreceiveRawBytes, stopRawReceivingreceiveDatagramBytes, stopDatagramReceivingnotifyStreamDisconnection, notifyStreamIncomingConnection, notifyStreamOutgoingConnection, notifyStreamSendBufferFree, receiveStreamBytes, stopStreamReceiving, streamSendAnswerpublic SAMv2Handler(SocketChannel s, int verMajor, int verMinor, Properties i2cpProps, SAMBridge parent) throws SAMException, IOException
s - Socket attached to a SAM clientverMajor - SAM major version to manage (should be 2)verMinor - SAM minor version to managei2cpProps - properties to configure the I2CP connection (host, port, etc)SAMException - if the version is not supportedIOException - if an I/O error occurspublic SAMv2Handler(SocketChannel s, int verMajor, int verMinor, SAMBridge parent) throws SAMException, IOException
s - Socket attached to a SAM clientverMajor - SAM major version to manage (should be 2)verMinor - SAM minor version to manageSAMException - if the version is not supportedIOException - if an I/O error occursprotected boolean execStreamMessage(String opcode, Properties props)
execStreamMessage in class SAMv1Handleropcode - the STREAM sub-commandprops - the parsed message propertiesSAMStreamSession newSAMv2StreamSession(String destKeystream, String direction, Properties props) throws IOException, DataFormatException, SAMException
public boolean verifVersion()
verifVersion in class SAMv1Handler