net.i2p.i2ptunnel.streamr

## Class StreamrConsumer

- java.lang.Object
- - net.i2p.util.EventDispatcherImpl
  - - net.i2p.i2ptunnel.I2PTunnelTask
    - - net.i2p.i2ptunnel.udpTunnel.I2PTunnelUDPClientBase
      - - net.i2p.i2ptunnel.streamr.StreamrConsumer

- All Implemented Interfaces:
    Sink, Source, EventDispatcher

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

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

      `_clientId, _context, l`

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

      `open, tunnel`

  - ### Constructor Summary

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

  - ### Method Summary

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

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

      `send, 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

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

  - ### Method Detail

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

    - #### startRunning

          public final void startRunning()

      Starts the consumer and begins receiving data.
      Overrides:
        `startRunning` in class `I2PTunnelUDPClientBase`