class MessageHandler extends Object implements I2PSessionMuxedListener
I2PSession -> MessageHandler -> PacketHandler -> ConnectionPacketHandler -> MessageInputStream
Constructor and Description |
---|
MessageHandler(I2PAppContext ctx,
ConnectionManager mgr) |
Modifier and Type | Method and Description |
---|---|
void |
addDisconnectListener(I2PSocketManager.DisconnectListener lsnr) |
void |
disconnected(I2PSession session)
Notify the client that the session has been terminated
|
void |
errorOccurred(I2PSession session,
String message,
Throwable error)
Notify the client that some error occurred
|
void |
messageAvailable(I2PSession session,
int msgId,
long size)
Instruct the client that the given session has received a message with
size # of bytes.
|
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 with
size # of bytes.
|
void |
removeDisconnectListener(I2PSocketManager.DisconnectListener lsnr) |
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.
|
public MessageHandler(I2PAppContext ctx, ConnectionManager mgr)
public void messageAvailable(I2PSession session, int msgId, long size)
messageAvailable
in interface I2PSessionListener
messageAvailable
in interface I2PSessionMuxedListener
session
- session to notifymsgId
- message number availablesize
- size of the messagepublic void messageAvailable(I2PSession session, int msgId, long size, int proto, int fromPort, int toPort)
messageAvailable
in interface I2PSessionMuxedListener
session
- session to notifymsgId
- message number availablesize
- size of the messageproto
- 1-254 or 0 for unspecifiedfromPort
- 1-65535 or 0 for unspecifiedtoPort
- 1-65535 or 0 for unspecifiedpublic void reportAbuse(I2PSession session, int severity)
reportAbuse
in interface I2PSessionListener
reportAbuse
in interface I2PSessionMuxedListener
session
- session to report abuse toseverity
- how bad the abuse ispublic void disconnected(I2PSession session)
disconnected
in interface I2PSessionListener
disconnected
in interface I2PSessionMuxedListener
session
- that has been terminatedpublic void errorOccurred(I2PSession session, String message, Throwable error)
errorOccurred
in interface I2PSessionListener
errorOccurred
in interface I2PSessionMuxedListener
session
- of the clientmessage
- to send to the client about the errorerror
- the actual errorpublic void addDisconnectListener(I2PSocketManager.DisconnectListener lsnr)
public void removeDisconnectListener(I2PSocketManager.DisconnectListener lsnr)