java.lang.Object
net.i2p.i2ptunnel.udp.I2PSource.Listener
- All Implemented Interfaces:
I2PSessionListener, I2PSessionMuxedListener
- Enclosing class:
I2PSource
Listener for incoming I2P datagrams, dispatching to the configured sink.
Constructor Summary
ConstructorsMethod Summary
All MethodsModifier and TypeMethodDescriptionvoiddisconnected(I2PSession arg0) Notify the client that the session has been terminated.voiderrorOccurred(I2PSession arg0, String arg1, Throwable arg2) Notify the client that some error occurred.voidmessageAvailable(I2PSession sess, int id, long size) Always throws, since the muxed variant must be used.voidmessageAvailable(I2PSession session, int id, long size, int proto, int fromPort, int toPort) Receive a datagram from I2P and queue it for the local socket.voidreportAbuse(I2PSession arg0, int arg1) 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.
Constructor Details
Listener
protected Listener()Constructor. The listener reads the source's dissector, sink and log, all reached through the enclosing instance it is bound to.
Method Details
messageAvailable
Always throws, since the muxed variant must be used.- Specified by:
messageAvailablein interfaceI2PSessionListener- Specified by:
messageAvailablein interfaceI2PSessionMuxedListener- Parameters:
sess- session to notifyid- 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- Throws:
IllegalStateException- unconditionally, with the message "muxed"
messageAvailable
public void messageAvailable(I2PSession session, int id, long size, int proto, int fromPort, int toPort) Receive a datagram from I2P and queue it for the local socket.- Specified by:
messageAvailablein interfaceI2PSessionMuxedListener- Parameters:
session- session to notifyid- 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
Description copied from interface:I2PSessionMuxedListenerInstruct 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- Specified by:
reportAbusein interfaceI2PSessionMuxedListener- Parameters:
arg0- session to report abuse toarg1- how bad the abuse is
disconnected
Description copied from interface:I2PSessionMuxedListenerNotify the client that the session has been terminated. All registered listeners will be called.- Specified by:
disconnectedin interfaceI2PSessionListener- Specified by:
disconnectedin interfaceI2PSessionMuxedListener- Parameters:
arg0- the session that was terminated
errorOccurred
Description copied from interface:I2PSessionMuxedListenerNotify the client that some error occurred. All registered listeners will be called.- Specified by:
errorOccurredin interfaceI2PSessionListener- Specified by:
errorOccurredin interfaceI2PSessionMuxedListener- Parameters:
arg0- the session that reported the errorarg1- a human-readable description of the errorarg2- the cause, non-null