Class NetworkTrafficSocketChannelEndPoint

    • Constructor Detail

      • NetworkTrafficSocketChannelEndPoint

        public NetworkTrafficSocketChannelEndPoint​(java.nio.channels.SelectableChannel channel,
                                                   ManagedSelector selectSet,
                                                   java.nio.channels.SelectionKey key,
                                                   Scheduler scheduler,
                                                   long idleTimeout,
                                                   java.util.List<NetworkTrafficListener> listeners)
    • Method Detail

      • fill

        public int fill​(java.nio.ByteBuffer buffer)
        Description copied from interface: EndPoint
        Fill the passed buffer with data from this endpoint. The bytes are appended to any data already in the buffer by writing from the buffers limit up to it's capacity. The limit is updated to include the filled bytes.
        Specified by:
        fill in interface EndPoint
        fill in class ChannelEndPoint
        buffer - The buffer to fill. The position and limit are modified during the fill. After the operation, the position is unchanged and the limit is increased to reflect the new data filled.
        an int value indicating the number of bytes filled or -1 if EOF is read or the input is shutdown.
        Throws: - if the endpoint is closed.
      • flush

        public boolean flush​(java.nio.ByteBuffer... buffers)
        Description copied from interface: EndPoint
        Flush data from the passed header/buffer to this endpoint. As many bytes as can be consumed are taken from the header/buffer position up until the buffer limit. The header/buffers position is updated to indicate how many bytes have been consumed.
        Specified by:
        flush in interface EndPoint
        flush in class ChannelEndPoint
        buffers - the buffers to flush
        True IFF all the buffers have been consumed and the endpoint has flushed the data to its destination (ie is not buffering any data).
        Throws: - If the endpoint is closed or output is shutdown.
      • notifyIncoming

        public void notifyIncoming​(java.nio.ByteBuffer buffer,
                                   int read)
      • notifyOutgoing

        public void notifyOutgoing​(java.nio.ByteBuffer view)