java.io.Closeable
, java.lang.AutoCloseable
, SAMMessageSess
, Session
MasterSession
class SAMv3StreamSession extends SAMStreamSession implements Session
_isOwnSession, _log, canCreate, DEFAULT_FORCE_FLUSH, forceFlush, PROP_FORCE_FLUSH, recv, server, SOCKET_HANDLER_BUF_SIZE, socketMgr
コンストラクタ | 説明 |
---|---|
SAMv3StreamSession(java.lang.String login) |
Create a new SAM STREAM session, according to information
registered with the given nickname
Caller MUST call start().
|
SAMv3StreamSession(java.lang.String login,
java.util.Properties props,
SAMv3Handler handler,
I2PSocketManager mgr,
int listenPort) |
Build a Stream Session on an existing I2P session
registered with the given nickname
Caller MUST call start().
|
修飾子とタイプ | メソッド | 説明 |
---|---|---|
void |
accept(SAMv3Handler handler,
boolean verbose) |
Accept a single incoming STREAM on the socket stolen from the handler.
|
void |
close() |
Close the stream session
TODO Why do we override?
|
void |
connect(SAMv3Handler handler,
java.lang.String dest,
java.util.Properties props) |
Connect the SAM STREAM session to the specified Destination
for a single connection, using the socket stolen from the handler.
|
static SessionsDB |
getDB() |
|
java.lang.String |
getNick() |
|
protected I2PServerSocket |
getSocketServer() |
|
boolean |
queueSocket(I2PSocket sock) |
Put a socket on the accept queue.
|
void |
startForwardingIncoming(java.util.Properties props,
boolean sendPorts) |
Forward sockets from I2P to the host/port provided.
|
void |
stopForwardingIncoming() |
stop Forwarding Incoming connection coming from I2P
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDestination, getListenPort, getListenProtocol, sendBytes, sendBytes, start
checkSocketHandlerId, closeConnection, connect, createSocketHandler, getDestination, getListenPort, getListenProtocol, getSocketReader, newSAMStreamSessionSocketReader, newStreamSender, removeSocketHandler, sendBytes, sendBytes, sendBytes, setReceiveLimit, start
public SAMv3StreamSession(java.lang.String login) throws java.io.IOException, DataFormatException, SAMException
login
- The nicknamejava.io.IOException
DataFormatException
SAMException
java.lang.NullPointerException
- if login nickname is not registeredpublic SAMv3StreamSession(java.lang.String login, java.util.Properties props, SAMv3Handler handler, I2PSocketManager mgr, int listenPort) throws java.io.IOException, DataFormatException, SAMException
login
- nickname of the sessionjava.io.IOException
DataFormatException
SAMException
public boolean queueSocket(I2PSocket sock)
public static SessionsDB getDB()
public void connect(SAMv3Handler handler, java.lang.String dest, java.util.Properties props) throws I2PException, java.net.ConnectException, java.net.NoRouteToHostException, DataFormatException, java.io.InterruptedIOException, java.io.IOException
handler
- The handler that communicates with the requesting clientdest
- Base64-encoded Destination to connect toprops
- Options to be used for connectionDataFormatException
- if the destination is not validjava.net.ConnectException
- if the destination refuses connectionsjava.net.NoRouteToHostException
- if the destination can't be reachedjava.io.InterruptedIOException
- if the connection timeoutsI2PException
- if there's another I2P-related errorjava.io.IOException
public void accept(SAMv3Handler handler, boolean verbose) throws I2PException, java.io.InterruptedIOException, java.io.IOException, SAMException
handler
- The handler that communicates with the requesting clientverbose
- If true, SAM will send the Base64-encoded peer Destination of an
incoming socket as the first line of data sent to its client
on the handler socketDataFormatException
- if the destination is not validjava.net.ConnectException
- if the destination refuses connectionsjava.net.NoRouteToHostException
- if the destination can't be reachedjava.io.InterruptedIOException
- if the connection timeoutsI2PException
- if there's another I2P-related errorjava.io.IOException
SAMException
public void startForwardingIncoming(java.util.Properties props, boolean sendPorts) throws SAMException, java.io.InterruptedIOException
SAMException
java.io.InterruptedIOException
protected I2PServerSocket getSocketServer()
public void stopForwardingIncoming() throws SAMException, java.io.InterruptedIOException
SAMException
java.io.InterruptedIOException
public void close()
close
インタフェース内 java.lang.AutoCloseable
close
インタフェース内 java.io.Closeable
close
インタフェース内 SAMMessageSess
close
クラス内 SAMStreamSession