All Implemented Interfaces:
Sink, Source, EventDispatcher

public class StreamrProducerextends I2PTunnelUDPServerBase
Streamr producer that acts as an I2P server and UDP client, receiving UDP data on a configured port and forwarding it through I2P.
  • Field Details

    • multi

      private final MultiSource multi
      Hands the incoming feed to this tunnel's listeners.
    • server

      private final UDPSource server
      The UDP socket the feed arrives on.
  • Constructor Details

    • StreamrProducer

      public StreamrProducer(int port, File privkey, String privkeyname, Logging l, EventDispatcher notifyThis, I2PTunnel tunnel)
      Creates a Streamr producer that receives UDP data and forwards it through I2P.
      Parameters:
      port - local UDP port to listen on
      privkey - I2P private key file for the destination
      privkeyname - name of the private key
      l - the logging facility passed on to the superclass
      notifyThis - event dispatcher for notifications
      tunnel - the owning I2PTunnel, which supplies the client options and context
  • Method Details

    • startRunning

      public final void startRunning()
      Starts the UDP server and begins forwarding data.
      Overrides:
      startRunning in class I2PTunnelUDPServerBase
    • close

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