class SAMv3Handler extends SAMv1Handler
Modifier and Type | Class and Description |
---|---|
static class |
SAMv3Handler.DatagramServer |
(package private) static interface |
SAMv3Handler.Session |
static class |
SAMv3Handler.SessionRecord |
static class |
SAMv3Handler.SessionsDB |
Modifier and Type | Field and Description |
---|---|
static SAMv3Handler.SessionsDB |
sSessionsHash |
_id, datagramSession, rawSession, streamSession
Constructor and Description |
---|
SAMv3Handler(SocketChannel s,
int verMajor,
int verMinor)
Create a new SAM version 3 handler.
|
SAMv3Handler(SocketChannel s,
int verMajor,
int verMinor,
Properties i2cpProps)
Create a new SAM version 3 handler.
|
Modifier and Type | Method and Description |
---|---|
protected void |
die() |
protected boolean |
execSessionMessage(String opcode,
Properties props) |
protected boolean |
execStreamAccept(Properties props) |
protected boolean |
execStreamConnect(Properties props) |
protected boolean |
execStreamForwardIncoming(Properties props) |
protected boolean |
execStreamMessage(String opcode,
Properties props) |
String |
getClientIP() |
void |
handle()
Actually handle the SAM protocol.
|
void |
notifyStreamIncomingConnection(Destination d) |
static void |
notifyStreamIncomingConnection(SocketChannel client,
Destination d) |
void |
notifyStreamResult(boolean verbose,
String result,
String message) |
void |
stealSocket() |
boolean |
verifVersion() |
execDatagramMessage, execDestMessage, execNamingMessage, execRawMessage, execStreamClose, execStreamSend, getDatagramSession, getRawSession, getStreamSession, notifyStreamDisconnection, notifyStreamIncomingConnection, notifyStreamOutgoingConnection, notifyStreamSendBufferFree, receiveDatagramBytes, receiveRawBytes, receiveStreamBytes, stopDatagramReceiving, stopRawReceiving, stopStreamReceiving, streamSendAnswer
closeClientSocket, getClientSocket, getWriteLock, run, setBridge, shouldStop, startHandling, stopHandling, toString, writeBytes, writeBytes, writeString, writeString
public static final SAMv3Handler.SessionsDB sSessionsHash
public SAMv3Handler(SocketChannel s, int verMajor, int verMinor) throws SAMException, IOException
s
- Socket attached to a SAM clientverMajor
- SAM major version to manage (should be 3)verMinor
- SAM minor version to manageSAMException
IOException
public SAMv3Handler(SocketChannel s, int verMajor, int verMinor, Properties i2cpProps) 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)SAMException
IOException
public boolean verifVersion()
verifVersion
in class SAMv1Handler
public String getClientIP()
public void stealSocket()
public void handle()
SAMHandler
handle
in class SAMv1Handler
protected void die()
protected boolean execSessionMessage(String opcode, Properties props)
execSessionMessage
in class SAMv1Handler
protected boolean execStreamMessage(String opcode, Properties props)
execStreamMessage
in class SAMv1Handler
protected boolean execStreamConnect(Properties props)
execStreamConnect
in class SAMv1Handler
protected boolean execStreamForwardIncoming(Properties props)
protected boolean execStreamAccept(Properties props)
public void notifyStreamResult(boolean verbose, String result, String message) throws IOException
IOException
public void notifyStreamIncomingConnection(Destination d) throws IOException
IOException
public static void notifyStreamIncomingConnection(SocketChannel client, Destination d) throws IOException
IOException