All Implemented Interfaces:
Sink, Source, EventDispatcher

public class StreamrConsumerextends I2PTunnelUDPClientBase
Streamr consumer that acts as an I2P client and UDP server, receiving data from I2P destinations and forwarding it to a configured UDP host/port.
  • Field Details

    • sink

      private final UDPSink sink
      Where received messages are delivered.
    • pinger

      private final Pinger pinger
      Sends the keep-alive pings.
  • Constructor Details

    • StreamrConsumer

      public StreamrConsumer(InetAddress host, int port, String destination, Logging l, EventDispatcher notifyThis, I2PTunnel tunnel)
      Creates a Streamr consumer that receives data from I2P and forwards it to a UDP destination.
      Parameters:
      host - UDP destination hostname
      port - UDP destination port
      destination - I2P destination to subscribe to
      l - the Logging instance this tunnel's status messages are sent to
      notifyThis - event dispatcher for notifications
      tunnel - the parent tunnel, supplying the context and I2CP options
  • Method Details

    • startRunning

      public final void startRunning()
      Starts the consumer and begins receiving data.
      Overrides:
      startRunning in class I2PTunnelUDPClientBase
    • close

      public boolean close(boolean forced)
      Stops the consumer and releases resources.
      Overrides:
      close in class I2PTunnelUDPClientBase
      Parameters:
      forced - if true, forces immediate close
      Returns:
      true if closed successfully