Handler
class SAMv3Handler extends SAMv1Handler
修飾子とタイプ | フィールド | 説明 |
---|---|---|
static SessionsDB |
sSessionsHash |
_log, bridge, i2cpProps, socket, stopHandler, stopLock, thread, verMajor, verMinor
_id, datagramSession, rawSession, SESSION_ERROR, streamSession
コンストラクタ | 説明 |
---|---|
SAMv3Handler(java.nio.channels.SocketChannel s,
int verMajor,
int verMinor,
java.util.Properties i2cpProps,
SAMBridge parent) |
Create a new SAM version 3 handler.
|
SAMv3Handler(java.nio.channels.SocketChannel s,
int verMajor,
int verMinor,
SAMBridge parent) |
Create a new SAM version 3 handler.
|
修飾子とタイプ | メソッド | 説明 |
---|---|---|
protected boolean |
execSessionMessage(java.lang.String opcode,
java.util.Properties props) |
|
protected boolean |
execStreamConnect(java.util.Properties props) |
|
protected boolean |
execStreamMessage(java.lang.String opcode,
java.util.Properties props) |
|
(package private) SAMBridge |
getBridge() |
For SAMv3StreamSession
|
java.lang.String |
getClientIP() |
|
(package private) Session |
getSession() |
For SAMv3DatagramServer
|
void |
handle() |
Actually handle the SAM protocol.
|
static void |
notifyStreamIncomingConnection(java.nio.channels.SocketChannel client,
Destination d) |
|
static void |
notifyStreamIncomingConnection(java.nio.channels.SocketChannel client,
Destination d,
int fromPort,
int toPort) |
|
void |
notifyStreamIncomingConnection(Destination d,
int fromPort,
int toPort) |
|
void |
notifyStreamResult(boolean verbose,
java.lang.String result,
java.lang.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, wait
closeClientSocket, getClientSocket, getWriteLock, run, shouldStop, startHandling, toString, writeBytes, writeString, writeString
createMessageString, execDatagramMessage, execDestMessage, execNamingMessage, execRawMessage, execStreamClose, execStreamSend, getDatagramSession, getRawSession, getStreamSession, notifyStreamDisconnection, notifyStreamIncomingConnection, notifyStreamOutgoingConnection, notifyStreamSendBufferFree, receiveDatagramBytes, receiveRawBytes, receiveStreamBytes, stopDatagramReceiving, stopRawReceiving, stopStreamReceiving, streamSendAnswer, writeString
public static final SessionsDB sSessionsHash
public SAMv3Handler(java.nio.channels.SocketChannel s, int verMajor, int verMinor, SAMBridge parent) throws SAMException, java.io.IOException
s
- Socket attached to a SAM clientverMajor
- SAM major version to manage (should be 3)verMinor
- SAM minor version to manageSAMException
java.io.IOException
public SAMv3Handler(java.nio.channels.SocketChannel s, int verMajor, int verMinor, java.util.Properties i2cpProps, SAMBridge parent) throws SAMException, java.io.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
java.io.IOException
public boolean verifVersion()
verifVersion
クラス内 SAMv1Handler
public java.lang.String getClientIP()
public void stealSocket()
SAMBridge getBridge()
Session getSession()
void setSession(SAMv3RawSession sess)
void setSession(SAMv3DatagramSession sess)
void setSession(SAMv3StreamSession sess)
public void handle()
SAMHandler
handle
クラス内 SAMv1Handler
public void stopHandling()
stopHandling
インタフェース内 Handler
stopHandling
クラス内 SAMHandler
protected boolean execSessionMessage(java.lang.String opcode, java.util.Properties props)
execSessionMessage
クラス内 SAMv1Handler
protected boolean execStreamMessage(java.lang.String opcode, java.util.Properties props)
execStreamMessage
クラス内 SAMv1Handler
protected boolean execStreamConnect(java.util.Properties props)
execStreamConnect
クラス内 SAMv1Handler
public void notifyStreamResult(boolean verbose, java.lang.String result, java.lang.String message) throws java.io.IOException
verbose
- if false, does nothingresult
- non-nullmessage
- may be nulljava.io.IOException
public void notifyStreamIncomingConnection(Destination d, int fromPort, int toPort) throws java.io.IOException
java.io.IOException
public static void notifyStreamIncomingConnection(java.nio.channels.SocketChannel client, Destination d) throws java.io.IOException
java.io.IOException
public static void notifyStreamIncomingConnection(java.nio.channels.SocketChannel client, Destination d, int fromPort, int toPort) throws java.io.IOException
java.io.IOException