Interface SocketServicer<R>


  • public interface SocketServicer<R>
    Services the Socket.
    Author:
    Daniel Sagenschneider
    • Method Detail

      • service

        void service​(StreamBuffer<java.nio.ByteBuffer> readBuffer,
                     long bytesRead,
                     boolean isNewBuffer)
              throws java.io.IOException
        Services the Socket.
        Parameters:
        readBuffer - StreamBuffer containing the just read bytes. Note that this could be the same StreamBuffer as previous, with just further bytes written.
        bytesRead - Number of bytes read.
        isNewBuffer - Indicates if the StreamBuffer is a new StreamBuffer. Due to StreamBufferPool, the same StreamBuffer may be re-used. This flag indicates if a new StreamBuffer with new data, even if same StreamBuffer instance.
        Throws:
        java.io.IOException - If fails to service the Socket. This indicates failure in servicing the connection and hence will close the connection.
      • release

        default void release()
        Releases this SocketServicer from use.