Class SOCKSUDPTunnel

  • All Implemented Interfaces:
    Sink, Source, EventDispatcher

    public class SOCKSUDPTunnel
    extends I2PTunnelUDPClientBase
    A Datagram Tunnel that can have multiple bidirectional ports on the UDP side. TX: (multiple SOCKSUDPPorts -> ) I2PSink RX: (SOCKSUDPWrapper in multiple SOCKSUDPPorts <- ) MultiSink <- I2PSource The replies must be to the same I2CP toPort as the outbound fromPort. If the server does not honor that, the replies will be dropped. The replies must be repliable. Raw datagrams are not supported, and would require a unique source port for each target. Preliminary, untested, possibly incomplete.
    Author:
    zzz modded from streamr/StreamrConsumer
    • Constructor Detail

      • SOCKSUDPTunnel

        public SOCKSUDPTunnel​(I2PTunnel tunnel)
        Set up a tunnel with no UDP side yet. Use add() for each port.
    • Method Detail

      • add

        public int add​(InetAddress host,
                       int port)
        Returns:
        the UDP port number
      • remove

        public void remove​(Integer port)
      • startRunning

        public final void startRunning()
        Description copied from class: I2PTunnelUDPClientBase
        Actually start working on outgoing connections. Classes should override to start UDP side as well. Not specified in I2PTunnelTask but used in both I2PTunnelClientBase and I2PTunnelServer so let's implement it here too.
        Overrides:
        startRunning in class I2PTunnelUDPClientBase
      • close

        public boolean close​(boolean forced)
        Description copied from class: I2PTunnelUDPClientBase
        I2PTunnelTask Methods Classes should override to close UDP side as well
        Overrides:
        close in class I2PTunnelUDPClientBase
        Returns:
        success