class SAMv3Handler extends SAMv1Handler
| Modifier and Type | Field and Description |
|---|---|
static SessionsDB |
sSessionsHash |
_id, datagramSession, rawSession, SESSION_ERROR, streamSession_log, bridge, i2cpProps, socket, stopHandler, stopLock, thread, verMajor, verMinor| Constructor and Description |
|---|
SAMv3Handler(SocketChannel s,
int verMajor,
int verMinor,
Properties i2cpProps,
SAMBridge parent)
Create a new SAM version 3 handler.
|
SAMv3Handler(SocketChannel s,
int verMajor,
int verMinor,
SAMBridge parent)
Create a new SAM version 3 handler.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
execSessionMessage(String opcode,
Properties props) |
protected boolean |
execStreamConnect(Properties props) |
protected boolean |
execStreamMessage(String opcode,
Properties props) |
(package private) SAMBridge |
getBridge()
For SAMv3StreamSession
|
String |
getClientIP() |
(package private) Session |
getSession()
For SAMv3DatagramServer
|
void |
handle()
Actually handle the SAM protocol.
|
void |
notifyStreamIncomingConnection(Destination d,
int fromPort,
int toPort) |
static void |
notifyStreamIncomingConnection(SocketChannel client,
Destination d) |
static void |
notifyStreamIncomingConnection(SocketChannel client,
Destination d,
int fromPort,
int toPort) |
void |
notifyStreamResult(boolean verbose,
String result,
String message) |
(package private) void |
setSession(SAMv3DatagramSession sess)
For subsessions created by MasterSession
|
(package private) void |
setSession(SAMv3RawSession sess)
For subsessions created by MasterSession
|
(package private) void |
setSession(SAMv3StreamSession sess)
For subsessions created by MasterSession
|
void |
stealSocket()
For SAMv3StreamSession connect and accept
|
void |
stopHandling()
Stop the SAM handler, close the socket,
unregister with the bridge.
|
boolean |
verifVersion() |
createMessageString, execDatagramMessage, execDestMessage, execNamingMessage, execRawMessage, execStreamClose, execStreamSend, getDatagramSession, getRawSession, getStreamSession, notifyStreamDisconnection, notifyStreamIncomingConnection, notifyStreamOutgoingConnection, notifyStreamSendBufferFree, receiveDatagramBytes, receiveRawBytes, receiveStreamBytes, stopDatagramReceiving, stopRawReceiving, stopStreamReceiving, streamSendAnswer, writeStringcloseClientSocket, getClientSocket, getWriteLock, run, shouldStop, startHandling, toString, writeBytes, writeString, writeStringpublic static final SessionsDB sSessionsHash
public SAMv3Handler(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 3)verMinor - SAM minor version to managei2cpProps - properties to configure the I2CP connection (host, port, etc)SAMExceptionIOExceptionpublic SAMv3Handler(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 3)verMinor - SAM minor version to manageSAMExceptionIOExceptionprotected boolean execSessionMessage(String opcode, Properties props)
execSessionMessage in class SAMv1Handlerprotected boolean execStreamConnect(Properties props)
execStreamConnect in class SAMv1Handlerprotected boolean execStreamMessage(String opcode, Properties props)
execStreamMessage in class SAMv1HandlerSAMBridge getBridge()
public String getClientIP()
Session getSession()
public void handle()
SAMHandlerhandle in class SAMv1Handlerpublic void notifyStreamIncomingConnection(Destination d, int fromPort, int toPort) throws IOException
IOExceptionpublic static void notifyStreamIncomingConnection(SocketChannel client, Destination d) throws IOException
IOExceptionpublic static void notifyStreamIncomingConnection(SocketChannel client, Destination d, int fromPort, int toPort) throws IOException
IOExceptionpublic void notifyStreamResult(boolean verbose,
String result,
String message)
throws IOException
verbose - if false, does nothingresult - non-nullmessage - may be nullIOExceptionvoid setSession(SAMv3DatagramSession sess)
void setSession(SAMv3RawSession sess)
void setSession(SAMv3StreamSession sess)
public void stealSocket()
public void stopHandling()
stopHandling in interface HandlerstopHandling in class SAMHandlerpublic boolean verifVersion()
verifVersion in class SAMv1Handler