java.io.Closeable, java.lang.AutoCloseable, I2PSessionListener, I2PSessionMuxedListener, SAMDatagramReceiver, SAMMessageSess, SAMRawReceiverclass MasterSession extends SAMv3StreamSession implements SAMDatagramReceiver, SAMRawReceiver, SAMMessageSess, I2PSessionMuxedListener
_isOwnSession, _log, canCreate, DEFAULT_FORCE_FLUSH, forceFlush, PROP_FORCE_FLUSH, recv, server, SOCKET_HANDLER_BUF_SIZE, socketMgr| コンストラクタ | 説明 |
|---|---|
MasterSession(java.lang.String nick,
SAMv3DatagramServer dgServer,
SAMv3Handler handler,
java.util.Properties props) |
Build a Session according to information
registered with the given nickname.
|
| 修飾子とタイプ | メソッド | 説明 |
|---|---|---|
void |
accept(SAMv3Handler handler,
boolean verbose) |
Accept a single incoming STREAM on the socket stolen from the handler.
|
java.lang.String |
add(java.lang.String nick,
java.lang.String style,
java.util.Properties props) |
Add a session
|
void |
close() |
Close the master session
Overridden to stop the acceptor.
|
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.
|
void |
disconnected(I2PSession session) |
Notify the client that the session has been terminated.
|
void |
errorOccurred(I2PSession session,
java.lang.String message,
java.lang.Throwable error) |
Notify the client that some error occurred.
|
int |
getListenPort() |
|
int |
getListenProtocol() |
|
void |
messageAvailable(I2PSession session,
int msgId,
long size) |
Will be called only if you register via
setSessionListener() or addSessionListener().
|
void |
messageAvailable(I2PSession session,
int msgId,
long size,
int proto,
int fromPort,
int toPort) |
Instruct the client that the given session has received a message
Will be called only if you register via addMuxedSessionListener().
|
void |
receiveDatagramBytes(Destination sender,
byte[] data,
int proto,
int fromPort,
int toPort) |
Send a byte array to a SAM client.
|
void |
receiveRawBytes(byte[] data,
int proto,
int fromPort,
int toPort) |
Send a byte array to a SAM client, without informations
regarding the sender.
|
java.lang.String |
remove(java.lang.String nick,
java.util.Properties props) |
Remove a session
|
void |
reportAbuse(I2PSession session,
int severity) |
Instruct the client that the session specified seems to be under attack
and that the client may wish to move its destination to another router.
|
void |
start() |
Overridden to start the acceptor.
|
void |
startForwardingIncoming(java.util.Properties props,
boolean sendPorts) |
Forward sockets from I2P to the host/port provided.
|
void |
stopDatagramReceiving() |
Does nothing.
|
void |
stopForwardingIncoming() |
does nothing
|
void |
stopRawReceiving() |
Does nothing.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetDestination, sendBytes, sendBytescheckSocketHandlerId, closeConnection, connect, createSocketHandler, getDestination, getSocketReader, newSAMStreamSessionSocketReader, newStreamSender, removeSocketHandler, sendBytes, sendBytes, sendBytes, setReceiveLimitgetDB, getNick, getSocketServer, queueSocketpublic MasterSession(java.lang.String nick,
SAMv3DatagramServer dgServer,
SAMv3Handler handler,
java.util.Properties props)
throws java.io.IOException,
DataFormatException,
SAMException
nick - nickname of the sessionjava.io.IOExceptionDataFormatExceptionSAMExceptionpublic void start()
start インタフェース内 SAMMessageSessstart クラス内 SAMStreamSessionpublic java.lang.String add(java.lang.String nick,
java.lang.String style,
java.util.Properties props)
public java.lang.String remove(java.lang.String nick,
java.util.Properties props)
public void receiveDatagramBytes(Destination sender, byte[] data, int proto, int fromPort, int toPort) throws java.io.IOException
SAMDatagramReceiverreceiveDatagramBytes インタフェース内 SAMDatagramReceiversender - Destinationdata - Byte array to be receivedproto - I2CP protocolfromPort - I2CP from porttoPort - I2CP to portjava.io.IOException - alwayspublic void stopDatagramReceiving()
stopDatagramReceiving インタフェース内 SAMDatagramReceiverpublic void receiveRawBytes(byte[] data,
int proto,
int fromPort,
int toPort)
throws java.io.IOException
SAMRawReceiverreceiveRawBytes インタフェース内 SAMRawReceiverdata - Byte array to be receivedproto - I2CP protocolfromPort - I2CP from porttoPort - I2CP to portjava.io.IOException - alwayspublic void stopRawReceiving()
stopRawReceiving インタフェース内 SAMRawReceiverpublic void connect(SAMv3Handler handler, java.lang.String dest, java.util.Properties props) throws I2PException
SAMv3StreamSessionconnect クラス内 SAMv3StreamSessionhandler - The handler that communicates with the requesting clientdest - Base64-encoded Destination to connect toprops - Options to be used for connectionI2PException - alwayspublic void accept(SAMv3Handler handler, boolean verbose) throws SAMException
SAMv3StreamSessionaccept クラス内 SAMv3StreamSessionhandler - 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 socketSAMException - alwayspublic void startForwardingIncoming(java.util.Properties props,
boolean sendPorts)
throws SAMException
SAMv3StreamSessionstartForwardingIncoming クラス内 SAMv3StreamSessionSAMException - alwayspublic void stopForwardingIncoming()
stopForwardingIncoming クラス内 SAMv3StreamSessionpublic int getListenProtocol()
getListenProtocol インタフェース内 SAMMessageSessgetListenProtocol クラス内 SAMStreamSessionpublic int getListenPort()
getListenPort インタフェース内 SAMMessageSessgetListenPort クラス内 SAMStreamSessionpublic void close()
close インタフェース内 java.lang.AutoCloseableclose インタフェース内 java.io.Closeableclose インタフェース内 SAMMessageSessclose クラス内 SAMv3StreamSessionpublic void disconnected(I2PSession session)
I2PSessionMuxedListenerdisconnected インタフェース内 I2PSessionListenerdisconnected インタフェース内 I2PSessionMuxedListenerpublic void errorOccurred(I2PSession session, java.lang.String message, java.lang.Throwable error)
I2PSessionMuxedListenererrorOccurred インタフェース内 I2PSessionListenererrorOccurred インタフェース内 I2PSessionMuxedListenererror - can be null? or not?public void messageAvailable(I2PSession session, int msgId, long size)
I2PSessionMuxedListenermessageAvailable インタフェース内 I2PSessionListenermessageAvailable インタフェース内 I2PSessionMuxedListenersession - session to notifymsgId - message number availablesize - size of the message - why it's a long and not an int is a mysterypublic void messageAvailable(I2PSession session, int msgId, long size, int proto, int fromPort, int toPort)
I2PSessionMuxedListenermessageAvailable インタフェース内 I2PSessionMuxedListenersession - session to notifymsgId - message number availablesize - size of the message - why it's a long and not an int is a mysteryproto - 1-254 or 0 for unspecifiedfromPort - 1-65535 or 0 for unspecifiedtoPort - 1-65535 or 0 for unspecifiedpublic void reportAbuse(I2PSession session, int severity)
I2PSessionMuxedListenerreportAbuse インタフェース内 I2PSessionListenerreportAbuse インタフェース内 I2PSessionMuxedListenersession - session to report abuse toseverity - how bad the abuse is