org.jboss.xnio
Interface TcpConnector

All Superinterfaces:
Connector<java.net.SocketAddress,TcpChannel>
All Known Subinterfaces:
CloseableTcpConnector
All Known Implementing Classes:
NioTcpConnector

public interface TcpConnector
extends Connector<java.net.SocketAddress,TcpChannel>

A connector specifically for connecting to TCP servers.


Method Summary
 FutureConnection<java.net.SocketAddress,TcpChannel> connectTo(java.net.SocketAddress dest, IoHandler<? super TcpChannel> handler)
          Establish a connection to a TCP server.
 FutureConnection<java.net.SocketAddress,TcpChannel> connectTo(java.net.SocketAddress src, java.net.SocketAddress dest, IoHandler<? super TcpChannel> handler)
          Establish a connection to a TCP server.
 TcpChannelSource createChannelSource(java.net.SocketAddress dest)
          Create a client that always connects to the given TCP server.
 TcpChannelSource createChannelSource(java.net.SocketAddress src, java.net.SocketAddress dest)
          Create a client that always connects to the given TCP server from the given source address.
 

Method Detail

connectTo

FutureConnection<java.net.SocketAddress,TcpChannel> connectTo(java.net.SocketAddress dest,
                                                              IoHandler<? super TcpChannel> handler)
Establish a connection to a TCP server.

Specified by:
connectTo in interface Connector<java.net.SocketAddress,TcpChannel>
Parameters:
dest - the destination address
handler - the handler for this connection
Returns:
the future result of this operation

connectTo

FutureConnection<java.net.SocketAddress,TcpChannel> connectTo(java.net.SocketAddress src,
                                                              java.net.SocketAddress dest,
                                                              IoHandler<? super TcpChannel> handler)
Establish a connection to a TCP server.

Specified by:
connectTo in interface Connector<java.net.SocketAddress,TcpChannel>
Parameters:
src - the source address
dest - the destination address
handler - the handler for this connection
Returns:
the future result of this operation

createChannelSource

TcpChannelSource createChannelSource(java.net.SocketAddress dest)
Create a client that always connects to the given TCP server.

Specified by:
createChannelSource in interface Connector<java.net.SocketAddress,TcpChannel>
Parameters:
dest - the destination to connect to
Returns:
the client

createChannelSource

TcpChannelSource createChannelSource(java.net.SocketAddress src,
                                     java.net.SocketAddress dest)
Create a client that always connects to the given TCP server from the given source address.

Specified by:
createChannelSource in interface Connector<java.net.SocketAddress,TcpChannel>
Parameters:
src - the source to connect from
dest - the destination to connect to
Returns:
the client