T - the address family encapsulated by this Acceptor's
associated ServerEndpointpublic interface Acceptor<T>
ServerEndpoint
and asynchronously notifies an associated AcceptorListener of
each accepted connection.
Once an Acceptor is listening, it will continue to accept
incoming connections until its shutdown() method is called. An
Acceptor may not be reused once it has started listening or
been shut down.
| Modifier and Type | Method and Description |
|---|---|
ServerEndpoint<T> |
getBoundEndpoint()
Returns the
ServerEndpoint on which this Acceptor
is listening. |
ServerEndpoint<T> |
getEndpoint()
Returns the
ServerEndpoint this Acceptor was
created with. |
void |
listen(AcceptorListener listener)
Passively accepts incoming connections on the associated
ServerEndpoint. |
void |
shutdown()
Shuts down this
Acceptor, releasing any resources in use. |
void listen(AcceptorListener listener) throws IOException
ServerEndpoint. This call may block until listening
succeeds, but does not block to wait for incoming connections.
Each accepted connection will result in an asynchronous call to
newConnection on the given
listener.listener - the listener that will be notified of new connectionsIOException - if there was a problem listening on the
ServerEndpointIllegalStateException - if the Acceptor has been
shut down or is already listeningServerEndpoint<T> getEndpoint()
ServerEndpoint this Acceptor was
created with.ServerEndpoint this Acceptor was
created withServerEndpoint<T> getBoundEndpoint()
ServerEndpoint on which this Acceptor
is listening.ServerEndpoint on which this Acceptor
is listeningIllegalStateException - if the Acceptor has been shut
down or was not listeningvoid shutdown()
Acceptor, releasing any resources in use.
Once shutdown, an Acceptor cannot be restarted.IllegalStateException - if the Acceptor has been
shut down or was not listeningCopyright © 2007-2013. All Rights Reserved.