Interface Transport

    • Method Detail

      • getMssSize

        int getMssSize()
      • setAlreadyRead

        void setAlreadyRead​(java.nio.ByteBuffer bytes_already_read)
        Inject the given already-read data back into the read stream.
        Parameters:
        bytes_already_read - data
      • getTransportEndpoint

        TransportEndpoint getTransportEndpoint()
        Get the socket channel used by the transport.
        Returns:
        the socket channel
      • isEncrypted

        boolean isEncrypted()
      • getEncryption

        java.lang.String getEncryption​(boolean verbose)
        Return a textual description of the encryption for this transport
        Returns:
      • getProtocol

        java.lang.String getProtocol()
      • isSOCKS

        boolean isSOCKS()
      • setReadyForRead

        void setReadyForRead()
        fake a wakeup so that a read cycle is attempted
      • write

        long write​(java.nio.ByteBuffer[] buffers,
                   int array_offset,
                   int length)
            throws java.io.IOException
        Write data to the transport from the given buffers. NOTE: Works like GatheringByteChannel.
        Parameters:
        buffers - from which bytes are to be retrieved
        array_offset - offset within the buffer array of the first buffer from which bytes are to be retrieved
        length - maximum number of buffers to be accessed
        Returns:
        number of bytes written
        Throws:
        java.io.IOException - on write error
      • read

        long read​(java.nio.ByteBuffer[] buffers,
                  int array_offset,
                  int length)
           throws java.io.IOException
        Read data from the transport into the given buffers. NOTE: Works like ScatteringByteChannel.
        Parameters:
        buffers - into which bytes are to be placed
        array_offset - offset within the buffer array of the first buffer into which bytes are to be placed
        length - maximum number of buffers to be accessed
        Returns:
        number of bytes read
        Throws:
        java.io.IOException - on read error
      • setTransportMode

        void setTransportMode​(int mode)
        Set the transport to the given speed mode.
        Parameters:
        mode - to change to
      • getTransportMode

        int getTransportMode()
        Get the transport's speed mode.
        Returns:
        current mode
      • connectOutbound

        void connectOutbound​(java.nio.ByteBuffer initial_data,
                             Transport.ConnectListener listener,
                             int priority)
        Kick off an outbound connection
        Parameters:
        listener -
      • connectedInbound

        void connectedInbound()
        Indicate that inbound connection is complete
      • close

        void close​(java.lang.String reason)
        Close the transport connection.
      • getUserData

        java.lang.Object getUserData​(java.lang.Object key)
      • setUserData

        void setUserData​(java.lang.Object key,
                         java.lang.Object value)
      • setTrace

        void setTrace​(boolean on)