Package org.simpleframework.transport
Interface SocketProcessor
-
- All Known Implementing Classes:
ContainerSocketProcessor
,TransportSocketProcessor
public interface SocketProcessor
TheSocketProcessor
interface represents a processor that is used to acceptSocket
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 anSSLEngine
an SSL hand shake may be performed before any messages on the socket are interpreted.- See Also:
SocketConnection
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
process(Socket socket)
Used to process theSocket
which is a full duplex TCP connection to a higher layer the application.void
stop()
This method is used to stop theSocketProcessor
such that it will accept no more sockets.
-
-
-
Method Detail
-
process
void process(Socket socket) throws java.io.IOException
Used to process theSocket
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:
java.io.IOException
-
stop
void stop() throws java.io.IOException
This method is used to stop theSocketProcessor
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:
java.io.IOException
-
-