|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.client.I2PSessionDemultiplexer
public class I2PSessionDemultiplexer
Implement multiplexing with a 1-byte 'protocol' and a two-byte 'port'. Listeners register with either addListener() or addMuxedListener(), depending on whether they want to hear about the protocol, from port, and to port for every received message. This only calls one listener, not all that apply.
Constructor Summary | |
---|---|
I2PSessionDemultiplexer(I2PAppContext ctx)
|
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public I2PSessionDemultiplexer(I2PAppContext ctx)
Method Detail |
---|
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)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |