Module swim.io
Package swim.io

Interface SocketContext

  • All Superinterfaces:
    ConnectionContext, FlowContext, SocketRef

    public interface SocketContext
    extends SocketRef, FlowContext
    Network socket context that manages asynchronous I/O operations for a non-blocking NIO network channel. A SocketContext is implicitly bound to a Socket, providing the Socket with the ability to modify its FlowControl state, access its read and write buffers, to become a different kind of Socket, and to close the socket.
    • Method Detail

      • socketSettings

        SocketSettings socketSettings()
        Returns the configuration parameters that govern the underlying network socket.
      • inputBuffer

        InputBuffer inputBuffer()
        Returns the buffer into which input data is read by the underlying network socket. The bound Socket reads from this buffer in response to doRead callbacks.
      • outputBuffer

        OutputBuffer<?> outputBuffer()
        Returns the buffer from which output data is written by the underlying network socket. The bound Socket writes to this buffer in repsonse to doWrite callbacks.
      • become

        void become​(Socket socket)
        Rebinds this SocketContext to a new socket implementation, thereby changing the Socket handler that receives network I/O callbacks.