public interface IoConnector extends IoService
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.
限定符和类型 | 方法和说明 |
---|---|
ConnectFuture |
connect(java.net.SocketAddress address,
IoHandler handler)
Connects to the specified
address . |
ConnectFuture |
connect(java.net.SocketAddress address,
IoHandler handler,
IoServiceConfig config)
Connects to the specified
address . |
ConnectFuture |
connect(java.net.SocketAddress address,
java.net.SocketAddress localAddress,
IoHandler handler)
Connects to the specified
address . |
ConnectFuture |
connect(java.net.SocketAddress address,
java.net.SocketAddress localAddress,
IoHandler handler,
IoServiceConfig config)
Connects to the specified
address . |
addListener, getDefaultConfig, getFilterChain, getFilterChainBuilder, getManagedServiceAddresses, getManagedSessions, isManaged, removeListener, setFilterChainBuilder
ConnectFuture connect(java.net.SocketAddress address, IoHandler handler)
address
. If communication starts
successfully, events are fired to the specified
handler
.ConnectFuture
that will tell the result of the connection attemptConnectFuture connect(java.net.SocketAddress address, IoHandler handler, IoServiceConfig config)
address
. If communication starts
successfully, events are fired to the specified
handler
.config
- the configurationConnectFuture
that will tell the result of the connection attemptConnectFuture connect(java.net.SocketAddress address, java.net.SocketAddress localAddress, IoHandler handler)
address
. If communication starts
successfully, events are fired to the specified
handler
.localAddress
- the local address the channel is bound toConnectFuture
that will tell the result of the connection attemptConnectFuture connect(java.net.SocketAddress address, java.net.SocketAddress localAddress, IoHandler handler, IoServiceConfig config)
address
. If communication starts
successfully, events are fired to the specified
handler
.config
- the configurationConnectFuture
that will tell the result of the connection attempt