Class NettyWsTransport

  • All Implemented Interfaces:
    Transport

    public class NettyWsTransport
    extends NettyTcpTransport
    Netty based WebSockets Transport that wraps and extends the TCP Transport.
    • Constructor Detail

      • NettyWsTransport

        public NettyWsTransport​(java.net.URI remoteLocation,
                                TransportOptions options,
                                boolean secure)
        Create a new transport instance
        Parameters:
        remoteLocation - the URI that defines the remote resource to connect to.
        options - the transport options used to configure the socket connection.
        secure - should the transport enable an SSL layer.
      • NettyWsTransport

        public NettyWsTransport​(TransportListener listener,
                                java.net.URI remoteLocation,
                                TransportOptions options,
                                boolean secure)
        Create a new transport instance
        Parameters:
        listener - the TransportListener that will receive events from this Transport.
        remoteLocation - the URI that defines the remote resource to connect to.
        options - the transport options used to configure the socket connection.
        secure - should the transport enable an SSL layer.
    • Method Detail

      • write

        public void write​(io.netty.buffer.ByteBuf output)
                   throws java.io.IOException
        Description copied from interface: Transport
        Writes a chunk of data over the Transport connection without performing an explicit flush on the transport.
        Specified by:
        write in interface Transport
        Overrides:
        write in class NettyTcpTransport
        Parameters:
        output - The buffer of data that is to be transmitted.
        Throws:
        java.io.IOException - if an error occurs during the write operation.
      • writeAndFlush

        public void writeAndFlush​(io.netty.buffer.ByteBuf output)
                           throws java.io.IOException
        Description copied from interface: Transport
        Writes a chunk of data over the Transport connection and requests a flush of all pending queued write operations
        Specified by:
        writeAndFlush in interface Transport
        Overrides:
        writeAndFlush in class NettyTcpTransport
        Parameters:
        output - The buffer of data that is to be transmitted.
        Throws:
        java.io.IOException - if an error occurs during the write operation.
      • handleConnected

        protected void handleConnected​(io.netty.channel.Channel channel)
                                throws java.lang.Exception
        Overrides:
        handleConnected in class NettyTcpTransport
        Throws:
        java.lang.Exception
      • handleChannelInactive

        protected void handleChannelInactive​(io.netty.channel.Channel channel)
                                      throws java.lang.Exception
        Overrides:
        handleChannelInactive in class NettyTcpTransport
        Throws:
        java.lang.Exception