net.i2p.client
Interface I2PSessionMuxedListener

All Superinterfaces:
I2PSessionListener
All Known Implementing Classes:
I2PSessionDemultiplexer

public interface I2PSessionMuxedListener
extends I2PSessionListener

Define a means for the router to asynchronously notify the client that a new message is available or the router is under attack.

Author:
zzz extends I2PSessionListener

Method Summary
 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
 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 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.
 

Method Detail

messageAvailable

void messageAvailable(I2PSession session,
                      int msgId,
                      long size)
Will be called only if you register via setSessionListener() or addSessionListener(). And if you are doing that, just use I2PSessionListener. If you register via addSessionListener(), this will be called only for the proto(s) and toport(s) you register for.

Specified by:
messageAvailable in interface I2PSessionListener
Parameters:
session - session to notify
msgId - message number available
size - size of the message - why it's a long and not an int is a mystery

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 message Will be called only if you register via addMuxedSessionListener(). Will be called only for the proto(s) and toport(s) you register for.

Parameters:
session - session to notify
msgId - message number available
size - size of the message - why it's a long and not an int is a mystery
proto - 1-254 or 0 for unspecified
fromport - 1-65535 or 0 for unspecified
toport - 1-65535 or 0 for unspecified

reportAbuse

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.

Specified by:
reportAbuse in interface I2PSessionListener
Parameters:
session - session to report abuse to
severity - how bad the abuse is

disconnected

void disconnected(I2PSession session)
Notify the client that the session has been terminated

Specified by:
disconnected in interface I2PSessionListener

errorOccurred

void errorOccurred(I2PSession session,
                   java.lang.String message,
                   java.lang.Throwable error)
Notify the client that some error occurred

Specified by:
errorOccurred in interface I2PSessionListener