net.i2p.i2ptunnel.socks

## Class SOCKSUDPUnwrapper

- java.lang.Object
- - net.i2p.i2ptunnel.socks.SOCKSUDPUnwrapper

- All Implemented Interfaces:
    Sink, Source

      public class SOCKSUDPUnwrapper
      extends Object
      implements Source, Sink

  Strip a SOCKS header off a datagram, convert it to a Destination and port Ref: RFC 1928

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SOCKSUDPUnwrapper(Map<I2PSocketAddress,SOCKSHeader> cache)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `send(Destination ignored_from, int fromPort, int toPort, byte[] data)` May throw RuntimeException from underlying sink
    `void` | `setSink(Sink sink)` Sets the sink for outgoing unwrapped UDP datagrams.
    `void` | `start()` Starts the unwrapper.

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

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

- - ### Constructor Detail

    - #### SOCKSUDPUnwrapper

          public SOCKSUDPUnwrapper(Map<I2PSocketAddress,SOCKSHeader> cache)

      Parameters:
        `cache` - put headers here to pass to SOCKSUDPWrapper

  - ### Method Detail

    - #### send

          public void send(Destination ignored_from,
                           int fromPort,
                           int toPort,
                           byte[] data)

      May throw RuntimeException from underlying sink
      Specified by:
        `send` in interface `Sink`
      Parameters:
        `ignored_from` - ignored
        `fromPort` - will be passed along
        `toPort` - ignored
      Throws:
        `RuntimeException`

    - #### setSink

          public void setSink(Sink sink)

      Sets the sink for outgoing unwrapped UDP datagrams.
      Specified by:
        `setSink` in interface `Source`
      Parameters:
        `sink` - the sink to receive unwrapped datagrams

    - #### start

          public void start()

      Starts the unwrapper. No-op for this implementation.
      Specified by:
        `start` in interface `Source`