net.i2p.sam
Class SAMv2Handler
java.lang.Object
net.i2p.sam.SAMHandler
net.i2p.sam.SAMv1Handler
net.i2p.sam.SAMv2Handler
- All Implemented Interfaces:
- Runnable, Handler, SAMDatagramReceiver, SAMRawReceiver, SAMStreamReceiver
class SAMv2Handler
- extends SAMv1Handler
- implements SAMRawReceiver, SAMDatagramReceiver, SAMStreamReceiver
Class able to handle a SAM version 2 client connection.
- Author:
- mkvore
Methods inherited from class net.i2p.sam.SAMv1Handler |
createMessageString, execDatagramMessage, execDestMessage, execNamingMessage, execRawMessage, execSessionMessage, execStreamClose, execStreamConnect, execStreamSend, getDatagramSession, getRawSession, getStreamSession, handle, notifyStreamDisconnection, notifyStreamIncomingConnection, notifyStreamOutgoingConnection, notifyStreamSendBufferFree, receiveDatagramBytes, receiveRawBytes, receiveStreamBytes, stopDatagramReceiving, stopRawReceiving, stopStreamReceiving, streamSendAnswer |
Methods inherited from class net.i2p.sam.SAMHandler |
closeClientSocket, getClientSocket, getWriteLock, run, shouldStop, startHandling, stopHandling, toString, writeBytes, writeBytes, writeString, writeString |
SAMv2Handler
public SAMv2Handler(SocketChannel s,
int verMajor,
int verMinor,
SAMBridge parent)
throws SAMException,
IOException
- Create a new SAM version 2 handler. This constructor expects
that the SAM HELLO message has been still answered (and
stripped) from the socket input stream.
- Parameters:
s
- Socket attached to a SAM clientverMajor
- SAM major version to manage (should be 2)verMinor
- SAM minor version to manage
- Throws:
SAMException
IOException
SAMv2Handler
public SAMv2Handler(SocketChannel s,
int verMajor,
int verMinor,
Properties i2cpProps,
SAMBridge parent)
throws SAMException,
IOException
- Create a new SAM version 2 handler. This constructor expects
that the SAM HELLO message has been still answered (and
stripped) from the socket input stream.
- Parameters:
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)
- Throws:
SAMException
IOException
verifVersion
public boolean verifVersion()
- Overrides:
verifVersion
in class SAMv1Handler
newSAMStreamSession
SAMStreamSession newSAMStreamSession(String destKeystream,
String direction,
Properties props)
throws IOException,
DataFormatException,
SAMException
- Throws:
IOException
DataFormatException
SAMException
execStreamMessage
protected boolean execStreamMessage(String opcode,
Properties props)
- Overrides:
execStreamMessage
in class SAMv1Handler