Package org.apache.mina.common
Interface IoConnector
-
- All Superinterfaces:
IoService
- All Known Implementing Classes:
BaseIoConnector
,DatagramConnector
,DatagramConnectorDelegate
,DelegatedIoConnector
,SocketConnector
,VmPipeConnector
public interface IoConnector extends IoService
Connects to endpoint, communicates with the server, and fires events toIoHandler
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.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ConnectFuture
connect(java.net.SocketAddress address, java.net.SocketAddress localAddress, IoHandler handler)
Connects to the specifiedaddress
.ConnectFuture
connect(java.net.SocketAddress address, java.net.SocketAddress localAddress, IoHandler handler, IoServiceConfig config)
Connects to the specifiedaddress
.ConnectFuture
connect(java.net.SocketAddress address, IoHandler handler)
Connects to the specifiedaddress
.ConnectFuture
connect(java.net.SocketAddress address, IoHandler handler, IoServiceConfig config)
Connects to the specifiedaddress
.-
Methods inherited from interface org.apache.mina.common.IoService
addListener, getDefaultConfig, getFilterChain, getFilterChainBuilder, getManagedServiceAddresses, getManagedSessions, isManaged, removeListener, setFilterChainBuilder
-
-
-
-
Method Detail
-
connect
ConnectFuture connect(java.net.SocketAddress address, IoHandler handler)
Connects to the specifiedaddress
. If communication starts successfully, events are fired to the specifiedhandler
.- Returns:
ConnectFuture
that will tell the result of the connection attempt
-
connect
ConnectFuture connect(java.net.SocketAddress address, IoHandler handler, IoServiceConfig config)
Connects to the specifiedaddress
. If communication starts successfully, events are fired to the specifiedhandler
.- Parameters:
config
- the configuration- Returns:
ConnectFuture
that will tell the result of the connection attempt
-
connect
ConnectFuture connect(java.net.SocketAddress address, java.net.SocketAddress localAddress, IoHandler handler)
Connects to the specifiedaddress
. If communication starts successfully, events are fired to the specifiedhandler
.- Parameters:
localAddress
- the local address the channel is bound to- Returns:
ConnectFuture
that will tell the result of the connection attempt
-
connect
ConnectFuture connect(java.net.SocketAddress address, java.net.SocketAddress localAddress, IoHandler handler, IoServiceConfig config)
Connects to the specifiedaddress
. If communication starts successfully, events are fired to the specifiedhandler
.- Parameters:
config
- the configuration- Returns:
ConnectFuture
that will tell the result of the connection attempt
-
-