Interface SocketProcessor

All Known Implementing Classes:
ContainerSocketProcessor, TransportSocketProcessor

public interface SocketProcessor
The SocketProcessor interface represents a processor that is used to accept Socket objects. Implementations of this object will typically hand the socket over for processing either by some form of protocol handler or message processor. If the socket contains an SSLEngine an SSL hand shake may be performed before any messages on the socket are interpreted.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    process(Socket socket)
    Used to process the Socket which is a full duplex TCP connection to a higher layer the application.
    void
    This method is used to stop the SocketProcessor such that it will accept no more sockets.
  • Method Details

    • process

      void process(Socket socket) throws IOException
      Used to process the Socket which is a full duplex TCP connection to a higher layer the application. It is this layer that is responsible for interpreting a protocol or handling messages in some manner. In the case of HTTP this will initiate the consumption of a HTTP request after any SSL handshake is finished if the connection is secure.
      Parameters:
      socket - this is the connected HTTP socket to process
      Throws:
      IOException
    • stop

      void stop() throws IOException
      This method is used to stop the SocketProcessor such that it will accept no more sockets. Stopping the server ensures that all resources occupied will be released. This is required so that all threads are stopped, and all memory is released.

      Typically this method is called once all connections to the server have been stopped. As a final act of shutting down the entire server all threads must be stopped, this allows collection of unused memory and the closing of file and socket resources.

      Throws:
      IOException