Class TunnelTransport<P extends Packet<?>>

  • Type Parameters:
    P -
    All Implemented Interfaces:
    TransportLayer<P>

    public class TunnelTransport<P extends Packet<?>>
    extends java.lang.Object
    implements TransportLayer<P>
    A Transport that translates the actual remote address to a connection on 'localhost' on the specified port.

    This is useful for when using an SSH tunnel.

    • Constructor Summary

      Constructors 
      Constructor Description
      TunnelTransport​(TransportLayer<P> tunnel, java.lang.String tunnelHost, int tunnelPort)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void connect​(java.net.InetSocketAddress remoteAddress)
      Connect to the remote side
      void disconnect()
      Disconnect from the remote side
      boolean isConnected()
      Checks if the transport layer is currently connected.
      void write​(P packet)
      Write the packet to the transport.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TunnelTransport

        public TunnelTransport​(TransportLayer<P> tunnel,
                               java.lang.String tunnelHost,
                               int tunnelPort)
    • Method Detail

      • connect

        public void connect​(java.net.InetSocketAddress remoteAddress)
                     throws java.io.IOException
        Description copied from interface: TransportLayer
        Connect to the remote side
        Specified by:
        connect in interface TransportLayer<P extends Packet<?>>
        Parameters:
        remoteAddress - The remote address to connect to
        Throws:
        java.io.IOException
      • disconnect

        public void disconnect()
                        throws java.io.IOException
        Description copied from interface: TransportLayer
        Disconnect from the remote side
        Specified by:
        disconnect in interface TransportLayer<P extends Packet<?>>
        Throws:
        java.io.IOException