Runnable, Handler, SAMDatagramReceiver, SAMRawReceiver, SAMStreamReceiverclass SAMv3Handler extends SAMv1Handler
| Modifier and Type | Field | Description |
|---|---|---|
static SessionsDB |
sSessionsHash |
_log, bridge, i2cpProps, socket, stopHandler, stopLock, thread, verMajor, verMinor_id, datagramSession, rawSession, SESSION_ERROR, streamSession| Constructor | 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 | 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.
|
static void |
notifyStreamIncomingConnection(SocketChannel client,
Destination d) |
|
static void |
notifyStreamIncomingConnection(SocketChannel client,
Destination d,
int fromPort,
int toPort) |
|
void |
notifyStreamIncomingConnection(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() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcloseClientSocket, getClientSocket, getWriteLock, run, shouldStop, startHandling, toString, writeBytes, writeString, writeStringcreateMessageString, execDatagramMessage, execDestMessage, execNamingMessage, execRawMessage, execStreamClose, execStreamSend, getDatagramSession, getRawSession, getStreamSession, notifyStreamDisconnection, notifyStreamIncomingConnection, notifyStreamOutgoingConnection, notifyStreamSendBufferFree, receiveDatagramBytes, receiveRawBytes, receiveStreamBytes, stopDatagramReceiving, stopRawReceiving, stopStreamReceiving, streamSendAnswer, writeStringpublic static final SessionsDB sSessionsHash
public 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 manageSAMExceptionIOExceptionpublic 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 boolean verifVersion()
verifVersion in class SAMv1Handlerpublic String getClientIP()
public void stealSocket()
SAMBridge getBridge()
Session getSession()
void setSession(SAMv3RawSession sess)
void setSession(SAMv3DatagramSession sess)
void setSession(SAMv3StreamSession sess)
public void handle()
SAMHandlerhandle in class SAMv1Handlerpublic void stopHandling()
stopHandling in interface HandlerstopHandling in class SAMHandlerprotected boolean execSessionMessage(String opcode, Properties props)
execSessionMessage in class SAMv1Handlerprotected boolean execStreamMessage(String opcode, Properties props)
execStreamMessage in class SAMv1Handlerprotected boolean execStreamConnect(Properties props)
execStreamConnect in class SAMv1Handlerpublic void notifyStreamResult(boolean verbose,
String result,
String message)
throws IOException
verbose - if false, does nothingresult - non-nullmessage - may be nullIOExceptionpublic 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
IOException