public class AsyncServerSocket extends AbstractState<ServerSocketState,IOException>
| Modifier and Type | Class and Description |
|---|---|
static interface |
AsyncServerSocket.ConnectListener |
| Constructor and Description |
|---|
AsyncServerSocket(ServerSocketChannel chan,
Executor e)
Constructor for AsyncServerSocket.
|
AsyncServerSocket(ServerSocketChannel chan,
Executor e,
AsyncSelector sel)
Constructor for AsyncServerSocket.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(AsyncServerSocket.ConnectListener listener)
addListener.
|
AsyncServerSocket |
bind(SocketAddress addr,
int backlog)
Binds the
ServerSocket to a specific address (IP address and port number). |
ServerSocketChannel |
channel()
channel.
|
AsyncServerSocket |
close()
close.
|
void |
removeListener(AsyncServerSocket.ConnectListener listener)
removeListener.
|
ServerSocket |
socket()
socket.
|
String |
toString() |
addStateListener, addStateNotifiable, attemptSetState, clearError, getError, getState, hasError, isStateTransitionAllowed, onListenerException, onStateTransition, removeStateListener, removeStateNotifiable, setError, setState, setState, throwIfError, waitForState, waitForState, waitForStateUninterruptiblypublic AsyncServerSocket(ServerSocketChannel chan, Executor e) throws IOException
Constructor for AsyncServerSocket.
chan - a ServerSocketChannel object.e - a Executor object.IOException - if any.public AsyncServerSocket(ServerSocketChannel chan, Executor e, AsyncSelector sel) throws ClosedChannelException
Constructor for AsyncServerSocket.
chan - a ServerSocketChannel object.e - a Executor object.sel - a AsyncSelector object.ClosedChannelException - if any.public void addListener(AsyncServerSocket.ConnectListener listener)
addListener.
listener - a
AsyncServerSocket.ConnectListener
object.public AsyncServerSocket bind(SocketAddress addr, int backlog) throws IOException
ServerSocket to a specific address (IP address and port number).
If the address is null, then the system will pick up an ephemeral port and a valid
local address to bind the socket.
The backlog argument must be a positive value greater than 0. If the value passed
if equal or less than 0, then the default value will be assumed.
addr - addressbacklog - backlogIllegalArgumentException - if endpoint is a SocketAddress subclass not
supported by this socketIOException - if errorpublic ServerSocketChannel channel()
channel.
ServerSocketChannel object.public AsyncServerSocket close()
close.
AsyncServerSocket object.public void removeListener(AsyncServerSocket.ConnectListener listener)
removeListener.
listener - a
AsyncServerSocket.ConnectListener
object.public ServerSocket socket()
socket.
ServerSocket object.Copyright © 2026. All rights reserved.