class SAMv3StreamSession extends SAMStreamSession implements Session
SAMStreamSession.DisconnectListener, SAMStreamSession.SAMStreamSessionServer, SAMStreamSession.SAMStreamSessionSocketReader, SAMStreamSession.SAMv1StreamSessionSocketReader, SAMStreamSession.StreamSender_isOwnSession, _log, canCreate, DEFAULT_FORCE_FLUSH, forceFlush, PROP_FORCE_FLUSH, recv, server, SOCKET_HANDLER_BUF_SIZE, socketMgr| Constructor and Description |
|---|
SAMv3StreamSession(String login)Create a new SAM STREAM session, according to information
registered with the given nickname
Caller MUST call start(). |
SAMv3StreamSession(String login,
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(). |
| Modifier and Type | Method and Description |
|---|---|
void | accept(SAMv3Handler handler,
boolean verbose)Accept a single incoming I2P stream and pipe data through the handler's
socket. |
void | close()Close the stream session
TODO Why do we override? |
void | connectAsync(SAMv3Handler handler,
String dest,
Properties props)Initiate an async STREAM CONNECT. |
static SessionsDB | getDB() |
String | getNick() |
protected I2PServerSocket | getSocketServer() |
boolean | queueSocket(I2PSocket sock)Put a socket on the accept queue. |
void | startForwardingIncoming(Properties props,
boolean sendPorts)Forward sockets from I2P to the host/port provided. |
void | stopForwardingIncoming()stop Forwarding Incoming connection coming from I2P |
checkSocketHandlerId, closeConnection, connect, createSocketHandler, getDestination, getListenPort, getListenProtocol, getSocketReader, isDestroyed, lookupDest, newSAMStreamSessionSocketReader, newStreamSender, removeSocketHandler, sendBytes, sendBytes, sendBytes, setReceiveLimit, startclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetDestination, getListenPort, getListenProtocol, lookupDest, sendBytes, sendBytes, startpublic SAMv3StreamSession(String login) throws IOException, DataFormatException, SAMException
login - The nicknameIOExceptionDataFormatExceptionSAMExceptionNullPointerException - if login nickname is not registeredpublic SAMv3StreamSession(String login, Properties props, SAMv3Handler handler, I2PSocketManager mgr, int listenPort)
login - nickname of the sessionpublic void accept(SAMv3Handler handler, boolean verbose) throws SAMException, InterruptedIOException
handler - handler whose socket becomes the I2P data pipeverbose - if true, send peer Destination as first lineSAMException - if a forwarding server is already activeInterruptedIOException - if session is gonepublic void close()
close in interface Closeableclose in interface AutoCloseableclose in interface SAMMessageSessclose in class SAMStreamSessionpublic void connectAsync(SAMv3Handler handler, String dest, Properties props) throws DataFormatException
handler - handler whose socket becomes the I2P data pipedest - Base64-encoded Destinationprops - connection optionsDataFormatException - if dest is invalidpublic static SessionsDB getDB()
protected I2PServerSocket getSocketServer()
public boolean queueSocket(I2PSocket sock)
public void startForwardingIncoming(Properties props, boolean sendPorts) throws SAMException, InterruptedIOException
public void stopForwardingIncoming()
throws SAMException,
InterruptedIOException