- All Superinterfaces:
I2PSessionListener
- All Known Implementing Classes:
I2PSessionDemultiplexer, I2PSessionDemultiplexer.NoPortsListener, I2PSource.Listener, KRPC, MasterSession, MessageHandler, SAMMessageSession.SAMMessageSessionHandler, TorrentKRPC, UDPTrackerClient
Method Summary
All MethodsModifier and TypeMethodDescriptionvoiddisconnected(I2PSession session) Notify the client that the session has been terminated.voiderrorOccurred(I2PSession session, String message, Throwable error) Notify the client that some error occurred.voidmessageAvailable(I2PSession session, int msgId, long size) Will be called only if you register via setSessionListener() or addSessionListener().voidmessageAvailable(I2PSession session, int msgId, long size, int proto, int fromport, int toport) Instruct the client that the given session has received a messagevoidreportAbuse(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.
Method Details
messageAvailable
Will be called only if you register via setSessionListener() or addSessionListener(). And if you are doing that, just useI2PSessionListener.If you register via addSessionListener(), this will be called only for the proto(s) and toport(s) you register for.
After this is called, the client should call receiveMessage(msgId), or discardMessage(msgId) to drop it without decompressing it. A message the client never claims is dropped by the session's unclaimed-message sweep (every 60 seconds), which logs a warning naming the message ID.
- Specified by:
messageAvailablein interfaceI2PSessionListener- Parameters:
session- session to notifymsgId- message number availablesize- size of the message payload in bytes. The I2CP payload size is an int internally and is widened to long here, so the value is never negative
messageAvailable
void messageAvailable(I2PSession session, int msgId, long size, int proto, int fromport, int toport) Instruct the client that the given session has received a messageWill be called only if you register via addMuxedSessionListener(). Will be called only for the proto(s) and toport(s) you register for.
After this is called, the client should call receiveMessage(msgId), or discardMessage(msgId) to drop it without decompressing it. A message the client never claims is dropped by the session's unclaimed-message sweep (every 60 seconds), which logs a warning naming the message ID.
Only one listener is called for a given message, even if more than one have registered. See I2PSessionDemultiplexer for details.
- Parameters:
session- session to notifymsgId- message number availablesize- size of the message payload in bytes. The I2CP payload size is an int internally and is widened to long here, so the value is never negativeproto- 1-254 or 0 for unspecifiedfromport- 1-65535 or 0 for unspecifiedtoport- 1-65535 or 0 for unspecified
reportAbuse
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. All registered listeners will be called.Unused. Not fully implemented.
- Specified by:
reportAbusein interfaceI2PSessionListener- Parameters:
session- session to report abuse toseverity- how bad the abuse is
disconnected
Notify the client that the session has been terminated. All registered listeners will be called.- Specified by:
disconnectedin interfaceI2PSessionListener- Parameters:
session- the session that was terminated
errorOccurred
Notify the client that some error occurred. All registered listeners will be called.- Specified by:
errorOccurredin interfaceI2PSessionListener- Parameters:
session- the session that reported the errormessage- a human-readable description of the errorerror- the cause, non-null