java.lang.Object
net.i2p.i2ptunnel.udp.I2PSource.Listener
All Implemented Interfaces:
I2PSessionListener, I2PSessionMuxedListener
Enclosing class:
I2PSource

protected class I2PSource.Listenerextends Object implements I2PSessionMuxedListener
Listener for incoming I2P datagrams, dispatching to the configured sink.
  • 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

      public void messageAvailable(I2PSession sess, int id, long size)
      Always throws, since the muxed variant must be used.
      Specified by:
      messageAvailable in interface I2PSessionListener
      Specified by:
      messageAvailable in interface I2PSessionMuxedListener
      Parameters:
      sess - session to notify
      id - message number available
      size - 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:
      messageAvailable in interface I2PSessionMuxedListener
      Parameters:
      session - session to notify
      id - message number available
      size - 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
      proto - 1-254 or 0 for unspecified
      fromPort - 1-65535 or 0 for unspecified
      toPort - 1-65535 or 0 for unspecified
    • reportAbuse

      public void reportAbuse(I2PSession arg0, int arg1)
      Description copied from interface: I2PSessionMuxedListener
      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:
      reportAbuse in interface I2PSessionListener
      Specified by:
      reportAbuse in interface I2PSessionMuxedListener
      Parameters:
      arg0 - session to report abuse to
      arg1 - how bad the abuse is
    • disconnected

      public void disconnected(I2PSession arg0)
      Description copied from interface: I2PSessionMuxedListener
      Notify the client that the session has been terminated. All registered listeners will be called.
      Specified by:
      disconnected in interface I2PSessionListener
      Specified by:
      disconnected in interface I2PSessionMuxedListener
      Parameters:
      arg0 - the session that was terminated
    • errorOccurred

      public void errorOccurred(I2PSession arg0, String arg1, Throwable arg2)
      Description copied from interface: I2PSessionMuxedListener
      Notify the client that some error occurred. All registered listeners will be called.
      Specified by:
      errorOccurred in interface I2PSessionListener
      Specified by:
      errorOccurred in interface I2PSessionMuxedListener
      Parameters:
      arg0 - the session that reported the error
      arg1 - a human-readable description of the error
      arg2 - the cause, non-null