public class I2PSessionDemultiplexer extends Object implements I2PSessionMuxedListener
Constructor and Description |
---|
I2PSessionDemultiplexer(I2PAppContext ctx) |
Modifier and Type | Method and Description |
---|---|
void |
addListener(I2PSessionListener l,
int proto,
int port)
For those that don't need to hear about the protocol and ports
in messageAvailable()
(Streaming lib)
|
void |
addMuxedListener(I2PSessionMuxedListener l,
int proto,
int port)
For those that do care
UDP perhaps
|
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)
unused
|
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 |
removeListener(int proto,
int port) |
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 I2PSessionDemultiplexer(I2PAppContext ctx)
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 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)
I2PSessionMuxedListener
messageAvailable
in interface I2PSessionMuxedListener
session
- 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)
I2PSessionMuxedListener
reportAbuse
in interface I2PSessionListener
reportAbuse
in interface I2PSessionMuxedListener
session
- session to report abuse toseverity
- how bad the abuse ispublic void disconnected(I2PSession session)
I2PSessionMuxedListener
disconnected
in interface I2PSessionListener
disconnected
in interface I2PSessionMuxedListener
public void errorOccurred(I2PSession session, String message, Throwable error)
I2PSessionMuxedListener
errorOccurred
in interface I2PSessionListener
errorOccurred
in interface I2PSessionMuxedListener
error
- can be null? or not?public void addListener(I2PSessionListener l, int proto, int port)
public void addMuxedListener(I2PSessionMuxedListener l, int proto, int port)
public void removeListener(int proto, int port)