Package 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
-
Field Summary
Fields inherited from class net.i2p.sam.SAMv1Handler
_id, datagramSession, rawSession, SESSION_ERROR, streamSessionFields inherited from class net.i2p.sam.SAMHandler
_log, bridge, i2cpProps, socket, stopHandler, stopLock, thread, verMajor, verMinor -
Constructor Summary
ConstructorsConstructorDescriptionSAMv2Handler(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. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanexecStreamMessage(String opcode, Properties props) (package private) SAMStreamSessionnewSAMStreamSession(String destKeystream, String direction, Properties props) booleanMethods 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, writeStringMethods inherited from class net.i2p.sam.SAMHandler
closeClientSocket, getClientSocket, getWriteLock, run, shouldStop, startHandling, stopHandling, toString, writeBytes, writeString, writeStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.i2p.sam.SAMDatagramReceiver
receiveDatagramBytes, stopDatagramReceivingMethods inherited from interface net.i2p.sam.SAMRawReceiver
receiveRawBytes, stopRawReceivingMethods inherited from interface net.i2p.sam.SAMStreamReceiver
notifyStreamDisconnection, notifyStreamIncomingConnection, notifyStreamOutgoingConnection, notifyStreamSendBufferFree, receiveStreamBytes, stopStreamReceiving, streamSendAnswer
-
Constructor Details
-
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:
SAMExceptionIOException
-
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:
SAMExceptionIOException
-
-
Method Details
-
verifVersion
public boolean verifVersion()- Overrides:
verifVersionin classSAMv1Handler
-
newSAMStreamSession
SAMStreamSession newSAMStreamSession(String destKeystream, String direction, Properties props) throws IOException, DataFormatException, SAMException -
execStreamMessage
- Overrides:
execStreamMessagein classSAMv1Handler
-