net.i2p.i2ptunnel.streamr

## Class StreamrProducer

- java.lang.Object
- - net.i2p.util.EventDispatcherImpl
  - - net.i2p.i2ptunnel.I2PTunnelTask
    - - net.i2p.i2ptunnel.udpTunnel.I2PTunnelUDPServerBase
      - - net.i2p.i2ptunnel.streamr.StreamrProducer

- All Implemented Interfaces:
    Sink, Source, EventDispatcher

      public class StreamrProducer
      extends 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 Summary

    - ### Fields inherited from class net.i2p.i2ptunnel.udpTunnel.I2PTunnelUDPServerBase

      `l, readTimeout, slock`

    - ### Fields inherited from class net.i2p.i2ptunnel.I2PTunnelTask

      `open, tunnel`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `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.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `close(boolean forced)` Stops the server and releases resources.
    `void` | `startRunning()` Starts the UDP server and begins forwarding data.

    - ### Methods inherited from class net.i2p.i2ptunnel.udpTunnel.I2PTunnelUDPServerBase

      `getReadTimeout, send, setReadTimeout, setSink, start`

    - ### Methods inherited from class net.i2p.i2ptunnel.I2PTunnelTask

      `connected, destroy, disconnected, errorOccurred, getBooleanOption, getId, getTunnel, isOpen, optionsUpdated, reportAbuse, routerDisconnected, setId, setName, setTunnel, toString`

    - ### Methods inherited from class net.i2p.util.EventDispatcherImpl

      `attachEventDispatcher, detachEventDispatcher, getEventDispatcher, getEvents, getEventValue, ignoreEvents, notifyEvent, unIgnoreEvents, waitEventValue`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### 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` - logging facility
        `notifyThis` - event dispatcher for notifications
        `tunnel` - the tunnel context

  - ### Method Detail

    - #### 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

    - #### startRunning

          public final void startRunning()

      Starts the UDP server and begins forwarding data.
      Overrides:
        `startRunning` in class `I2PTunnelUDPServerBase`