public interface IoConnector extends IoSessionManager
IoHandler
s.
Please refer to NetCat example.
You should connect to the desired socket address to start communication,
and then events for incoming connections will be sent to the specified
default IoHandler
.
Threads connect to endpoint start automatically when
connect(SocketAddress, IoHandler)
is invoked, and stop when all
connection attempts are finished.
Modifier and Type | Method and Description |
---|---|
IoSession |
connect(java.net.SocketAddress address,
int timeout,
IoHandler handler)
Connects to the specified
address with timeout. |
IoSession |
connect(java.net.SocketAddress address,
IoHandler handler)
Connects to the specified
address . |
IoSession |
connect(java.net.SocketAddress address,
java.net.SocketAddress localAddress,
int timeout,
IoHandler handler)
Connects to the specified
address with timeout. |
IoSession |
connect(java.net.SocketAddress address,
java.net.SocketAddress localAddress,
IoHandler handler)
Connects to the specified
address . |
getFilterChain
getExceptionMonitor, setExceptionMonitor
IoSession connect(java.net.SocketAddress address, IoHandler handler) throws java.io.IOException
address
. If communication starts
successfully, events are fired to the specified
handler
. This method blocks.java.io.IOException
- if failed to connectIoSession connect(java.net.SocketAddress address, java.net.SocketAddress localAddress, IoHandler handler) throws java.io.IOException
address
. If communication starts
successfully, events are fired to the specified
handler
. This method blocks.localAddress
- the local address the channel is bound tojava.io.IOException
- if failed to connectIoSession connect(java.net.SocketAddress address, int timeout, IoHandler handler) throws java.io.IOException
address
with timeout. If
communication starts successfully, events are fired to the specified
handler
. This method blocks.java.io.IOException
- if failed to connectIoSession connect(java.net.SocketAddress address, java.net.SocketAddress localAddress, int timeout, IoHandler handler) throws java.io.IOException
address
with timeout. If
communication starts successfully, events are fired to the specified
handler
. This method blocks.localAddress
- the local address the channel is bound tojava.io.IOException
- if failed to connect