XNIO version 1.1.1.GA

org.jboss.xnio
Interface TcpConnector

All Superinterfaces:
Connector<SocketAddress,TcpChannel>
All Known Subinterfaces:
CloseableTcpConnector

public interface TcpConnector
extends Connector<SocketAddress,TcpChannel>

A connector specifically for connecting to TCP servers.


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

Method Detail

connectTo

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

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

connectTo

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

Specified by:
connectTo in interface Connector<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(SocketAddress dest)
Create a client that always connects to the given TCP server.

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

createChannelSource

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

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

XNIO version 1.1.1.GA

Copyright © 2008 JBoss, a division of Red Hat, Inc.