public class NioTcpClient extends AbstractTcpClient
AbstractIoService.ServiceStateconfig, ioHandlerExecutor| Constructor and Description |
|---|
NioTcpClient()
Create a TCP client with new selector pool of default size and a
IoHandlerExecutor of default type (
OrderedHandlerExecutor) |
NioTcpClient(SelectorLoopPool selectorLoopPool,
IoHandlerExecutor handlerExecutor)
Create a TCP client with provided selector loops pool.
|
NioTcpClient(SelectorLoop connectSelectorLoop,
SelectorLoopPool readWriteSelectorLoop,
IoHandlerExecutor handlerExecutor)
Create a TCP client with provided selector loops pool
|
| Modifier and Type | Method and Description |
|---|---|
IoFuture<IoSession> |
connect(SocketAddress remoteAddress)
Connects to the specified remote address.
|
void |
disconnect() |
getConnectTimeoutMillis, getSessionConfig, setConnectTimeoutMillis, setSessionConfigfireServiceActivated, fireServiceInactivated, getFilters, getIoHandler, getIoHandlerExecutor, getManagedSessions, initState, isActive, isCreated, isDisposed, isDisposing, isSuspended, setActive, setCreated, setDisposed, setDisposing, setFilters, setIoHandler, setSuspendedpublic NioTcpClient()
IoHandlerExecutor of default type (
OrderedHandlerExecutor)public NioTcpClient(SelectorLoopPool selectorLoopPool, IoHandlerExecutor handlerExecutor)
readWriteSelectorLoop - the pool of selector loop for handling read/write events of connected sessionsioHandlerExecutor - used for executing IoHandler event in another pool of thread (not in the low level I/O
one). Use null if you don't want one. Be careful, the IoHandler processing will block the I/O
operations.public NioTcpClient(SelectorLoop connectSelectorLoop, SelectorLoopPool readWriteSelectorLoop, IoHandlerExecutor handlerExecutor)
connectSelectorLoop - the selector loop for handling connection events (connection of new session)readWriteSelectorLoop - the pool of selector loop for handling read/write events of connected sessionsioHandlerExecutor - used for executing IoHandler event in another pool of thread (not in the low level I/O
one). Use null if you don't want one. Be careful, the IoHandler processing will block the I/O
operations.public IoFuture<IoSession> connect(SocketAddress remoteAddress)
remoteAddress - Remote SocketAddress to connectIoFuture instance which is completed when the connection attempt initiated by this call
succeeds or fails.public void disconnect()
throws IOException
IOExceptionCopyright © 2009–2013 Apache MINA Project. All rights reserved.