Package org.apache.hc.core5.reactor
Interface ConnectionAcceptor
-
- All Known Implementing Classes:
AsyncServer
,DefaultListeningIOReactor
,HttpAsyncServer
,SingleCoreListeningIOReactor
public interface ConnectionAcceptor
Non-blocking connection acceptor.- Since:
- 5.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.Set<ListenerEndpoint>
getEndpoints()
Returns a set of endpoints for this I/O reactor.default java.util.concurrent.Future<ListenerEndpoint>
listen(java.net.SocketAddress address, java.lang.Object attachment, FutureCallback<ListenerEndpoint> callback)
Opens a new listener endpoint with the given socket address.java.util.concurrent.Future<ListenerEndpoint>
listen(java.net.SocketAddress address, FutureCallback<ListenerEndpoint> callback)
Opens a new listener endpoint with the given socket address.void
pause()
Suspends the I/O reactor preventing it from accepting new connections on all active endpoints.void
resume()
Resumes the I/O reactor restoring its ability to accept incoming connections on all active endpoints.
-
-
-
Method Detail
-
listen
default java.util.concurrent.Future<ListenerEndpoint> listen(java.net.SocketAddress address, java.lang.Object attachment, FutureCallback<ListenerEndpoint> callback)
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.- Parameters:
address
- the socket address to listen on.attachment
- the attachment object.callback
- the result callback.- Returns:
- listener endpoint.
- Since:
- 5.2
-
listen
java.util.concurrent.Future<ListenerEndpoint> listen(java.net.SocketAddress address, FutureCallback<ListenerEndpoint> callback)
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.- Parameters:
address
- the socket address to listen on.callback
- the result callback.- Returns:
- listener endpoint.
-
pause
void pause() throws java.io.IOException
Suspends 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.IOException
Resumes 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.
-
-