Top Description Methods
org.apache.hc.core5.reactor

public Interface ConnectionAcceptor

Known Direct Implementers
org.apache.hc.core5.reactor.DefaultListeningIOReactor, org.apache.hc.core5.reactor.SingleCoreListeningIOReactor, org.apache.hc.core5.http.impl.bootstrap.AsyncServer
Imports
java.io.IOException, java.net.SocketAddress, java.util.Set, java.util.concurrent.Future, org.apache.hc.core5.concurrent.FutureCallback

Non-blocking connection acceptor.
Since
5.0

Method Summary

Modifier and TypeMethod and Description
public Set<ListenerEndpoint>

Returns:

set of endpoints.
getEndpoints
()

Returns a set of endpoints for this I/O reactor.

public default Future<ListenerEndpoint>

Returns:

listener endpoint.
listen
(SocketAddress
the socket address to listen on.
address
,
Object
the attachment object.
attachment
,
FutureCallback<ListenerEndpoint>
the result callback.
callback
)

Opens a new listener endpoint with the given socket address.

public Future<ListenerEndpoint>

Returns:

listener endpoint.
listen
(SocketAddress
the socket address to listen on.
address
,
FutureCallback<ListenerEndpoint>
the result callback.
callback
)

Opens a new listener endpoint with the given socket address.

public void
pause()

Suspends the I/O reactor preventing it from accepting new connections on all active endpoints.

public void
resume()

Resumes the I/O reactor restoring its ability to accept incoming connections on all active endpoints.

Method Detail

getEndpointsback to summary
public Set<ListenerEndpoint> getEndpoints()

Returns a set of endpoints for this I/O reactor.

Returns:Set<ListenerEndpoint>

set of endpoints.

listenback to summary
public default Future<ListenerEndpoint> listen(SocketAddress address, 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:SocketAddress

the socket address to listen on.

attachment:Object

the attachment object.

callback:FutureCallback<ListenerEndpoint>

the result callback.

Returns:Future<ListenerEndpoint>

listener endpoint.

Since
5.2
listenback to summary
public Future<ListenerEndpoint> listen(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:SocketAddress

the socket address to listen on.

callback:FutureCallback<ListenerEndpoint>

the result callback.

Returns:Future<ListenerEndpoint>

listener endpoint.

pauseback to summary
public void pause() throws IOException

Suspends the I/O reactor preventing it from accepting new connections on all active endpoints.

Exceptions
IOException:
in case of an I/O error.
resumeback to summary
public void resume() throws IOException

Resumes the I/O reactor restoring its ability to accept incoming connections on all active endpoints.

Exceptions
IOException:
in case of an I/O error.