Module 

Class FramedMessageChannel

    • Constructor Detail

      • FramedMessageChannel

        public FramedMessageChannel​(ConnectedStreamChannel channel,
                                    java.nio.ByteBuffer receiveBuffer,
                                    java.nio.ByteBuffer transmitBuffer)
        Deprecated.
        Construct a new instance.
        Parameters:
        channel - the channel to wrap
        receiveBuffer - the receive buffer (should be direct)
        transmitBuffer - the send buffer (should be direct)
      • FramedMessageChannel

        public FramedMessageChannel​(ConnectedStreamChannel channel,
                                    Pooled<java.nio.ByteBuffer> receiveBuffer,
                                    Pooled<java.nio.ByteBuffer> transmitBuffer)
        Deprecated.
        Construct a new instance.
        Parameters:
        channel - the channel to wrap
        receiveBuffer - the receive buffer (should be direct)
        transmitBuffer - the send buffer (should be direct)
    • Method Detail

      • receive

        public int receive​(java.nio.ByteBuffer buffer)
                    throws java.io.IOException
        Deprecated.
        Receive a message.
        Specified by:
        receive in interface ReadableMessageChannel
        Parameters:
        buffer - the buffer that will hold the message
        Returns:
        the size of the received message, 0 if no message is available, and -1 if the message channel has reached an end-of-file condition
        Throws:
        java.io.IOException - if an I/O error occurs
      • receive

        public long receive​(java.nio.ByteBuffer[] buffers)
                     throws java.io.IOException
        Deprecated.
        Receive a message.
        Specified by:
        receive in interface ReadableMessageChannel
        Parameters:
        buffers - the buffers that will hold the message
        Returns:
        the size of the received message, 0 if no message is available, and -1 if the message channel has reached an end-of-file condition
        Throws:
        java.io.IOException - if an I/O error occurs
      • receive

        public long receive​(java.nio.ByteBuffer[] buffers,
                            int offs,
                            int len)
                     throws java.io.IOException
        Deprecated.
        Receive a message.
        Specified by:
        receive in interface ReadableMessageChannel
        Parameters:
        buffers - the buffers that will hold the message
        offs - the offset into the array of buffers of the first buffer to read into
        len - the number of buffers to fill
        Returns:
        the size of the received message, 0 if no message is available, and -1 if the message channel has reached an end-of-file condition
        Throws:
        java.io.IOException - if an I/O error occurs
      • send

        public boolean send​(java.nio.ByteBuffer buffer)
                     throws java.io.IOException
        Deprecated.
        Send a complete message.
        Specified by:
        send in interface WritableMessageChannel
        Parameters:
        buffer - the message to send
        Returns:
        the result of the send operation; true if the message was sent, or false if it would block
        Throws:
        java.io.IOException - if an I/O error occurs
      • send

        public boolean send​(java.nio.ByteBuffer[] buffers)
                     throws java.io.IOException
        Deprecated.
        Send a complete message.
        Specified by:
        send in interface WritableMessageChannel
        Parameters:
        buffers - the buffers holding the message to send
        Returns:
        the result of the send operation; true if the message was sent, or false if it would block
        Throws:
        java.io.IOException - if an I/O error occurs
      • send

        public boolean send​(java.nio.ByteBuffer[] buffers,
                            int offs,
                            int len)
                     throws java.io.IOException
        Deprecated.
        Send a complete message.
        Specified by:
        send in interface WritableMessageChannel
        Parameters:
        buffers - the buffers holding the message to send
        offs - the offset into the buffer array of the first buffer
        len - the number of buffers that contain data to send
        Returns:
        the result of the send operation; true if the message was sent, or false if it would block
        Throws:
        java.io.IOException - if an I/O error occurs
      • sendFinal

        public boolean sendFinal​(java.nio.ByteBuffer buffer)
                          throws java.io.IOException
        Deprecated.
        Description copied from interface: WritableMessageChannel
        Send a complete message. If the message was successfully sent the channel with have its writes shutdown.
        Specified by:
        sendFinal in interface WritableMessageChannel
        Parameters:
        buffer - the message to send
        Returns:
        the result of the send operation; true if the message was sent, or false if it would block
        Throws:
        java.io.IOException - if an I/O error occurs
      • sendFinal

        public boolean sendFinal​(java.nio.ByteBuffer[] buffers)
                          throws java.io.IOException
        Deprecated.
        Description copied from interface: WritableMessageChannel
        Send a complete message. If the message was successfully sent the channel with have its writes shutdown.
        Specified by:
        sendFinal in interface WritableMessageChannel
        Parameters:
        buffers - the buffers holding the message to send
        Returns:
        the result of the send operation; true if the message was sent, or false if it would block
        Throws:
        java.io.IOException - if an I/O error occurs
      • sendFinal

        public boolean sendFinal​(java.nio.ByteBuffer[] buffers,
                                 int offs,
                                 int len)
                          throws java.io.IOException
        Deprecated.
        Description copied from interface: WritableMessageChannel
        Send a complete message. If the message was successfully sent the channel with have its writes shutdown.
        Specified by:
        sendFinal in interface WritableMessageChannel
        Parameters:
        buffers - the buffers holding the message to send
        offs - the offset into the buffer array of the first buffer
        len - the number of buffers that contain data to send
        Returns:
        the result of the send operation; true if the message was sent, or false if it would block
        Throws:
        java.io.IOException - if an I/O error occurs
      • flushAction

        protected boolean flushAction​(boolean shutDown)
                               throws java.io.IOException
        Deprecated.
        Description copied from class: TranslatingSuspendableChannel
        The action to perform when the channel is flushed. By default, this method delegates to the underlying channel. If the shutDown parameter is set, and this method returns true, the underlying channel will be shut down and this method will never be called again (future calls to TranslatingSuspendableChannel.flush() will flush the underlying channel until it returns true).
        Overrides:
        flushAction in class TranslatingSuspendableChannel<ConnectedMessageChannel,​ConnectedStreamChannel>
        Parameters:
        shutDown - true if the channel's write side has been shut down, false otherwise
        Returns:
        true if the flush succeeded, false if it would block
        Throws:
        java.io.IOException - if an error occurs
      • getPeerAddress

        public java.net.SocketAddress getPeerAddress()
        Deprecated.
        Get the peer address of this channel.
        Specified by:
        getPeerAddress in interface ConnectedChannel
        Returns:
        the peer address
      • getPeerAddress

        public <A extends java.net.SocketAddress> A getPeerAddress​(java.lang.Class<A> type)
        Deprecated.
        Get the peer address of a given type, or null if the address is not of that type.
        Specified by:
        getPeerAddress in interface ConnectedChannel
        Parameters:
        type - the address type class
        Returns:
        the peer address, or null if unknown
      • getLocalAddress

        public java.net.SocketAddress getLocalAddress()
        Deprecated.
        Get the local address that this channel is bound to.
        Specified by:
        getLocalAddress in interface BoundChannel
        Returns:
        the local address
      • getLocalAddress

        public <A extends java.net.SocketAddress> A getLocalAddress​(java.lang.Class<A> type)
        Deprecated.
        Get the local address of a given type, or null if the address is not of that type.
        Specified by:
        getLocalAddress in interface BoundChannel
        Type Parameters:
        A - the address type
        Parameters:
        type - the address type class
        Returns:
        the local address, or null if unknown