Package org.apache.http.nio.reactor
Interface ListeningIOReactor
-
- All Superinterfaces:
IOReactor
- All Known Implementing Classes:
DefaultListeningIOReactor
public interface ListeningIOReactor extends IOReactor
ListeningIOReactor represents an I/O reactor capable of listening for incoming connections on one or several ports.- Since:
- 4.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Set<ListenerEndpoint>getEndpoints()Returns a set of endpoints for this I/O reactor.ListenerEndpointlisten(java.net.SocketAddress address)Opens a new listener endpoint with the given socket address.voidpause()Suspends the I/O reactor preventing it from accepting new connections on all active endpoints.voidresume()Resumes the I/O reactor restoring its ability to accept incoming connections on all active endpoints.
-
-
-
Method Detail
-
listen
ListenerEndpoint listen(java.net.SocketAddress address)
Opens a new listener endpoint with the given socket address. Once the endpoint is fully initialized it starts accepting incoming connections and propagates I/O activity notifications to the I/O event dispatcher.ListenerEndpoint.waitFor()can be used to wait for the listener to be come ready to accept incoming connections.ListenerEndpoint.close()can be used to shut down the listener even before it is fully initialized.- Parameters:
address- the socket address to listen on.- Returns:
- listener endpoint.
-
pause
void pause() throws java.io.IOExceptionSuspends the I/O reactor preventing it from accepting new connections on all active endpoints.- Throws:
java.io.IOException- in case of an I/O error.
-
resume
void resume() throws java.io.IOExceptionResumes the I/O reactor restoring its ability to accept incoming connections on all active endpoints.- Throws:
java.io.IOException- in case of an I/O error.
-
getEndpoints
java.util.Set<ListenerEndpoint> getEndpoints()
Returns a set of endpoints for this I/O reactor.- Returns:
- set of endpoints.
-
-