XNIO API 2.1.0.CR2

org.jboss.xnio
Interface TcpConnector

All Superinterfaces:
Connector<InetSocketAddress,TcpChannel>

public interface TcpConnector
extends Connector<InetSocketAddress,TcpChannel>

A connector specifically for connecting to TCP servers.


Method Summary
 IoFuture<TcpChannel> connectTo(InetSocketAddress destination, ChannelListener<? super TcpChannel> openListener, ChannelListener<? super BoundChannel<InetSocketAddress>> bindListener)
          Establish a connection to a TCP server.
 TcpChannelSource createChannelSource(InetSocketAddress destination)
          Create a channel source that always connects to the given TCP server.
 

Method Detail

connectTo

IoFuture<TcpChannel> connectTo(InetSocketAddress destination,
                               ChannelListener<? super TcpChannel> openListener,
                               ChannelListener<? super BoundChannel<InetSocketAddress>> bindListener)
Establish a connection to a TCP server.

Specified by:
connectTo in interface Connector<InetSocketAddress,TcpChannel>
Parameters:
destination - the destination address
openListener - the listener which will be notified when the channel is open, or null for none
bindListener - the listener which will be notified when the channel is bound, or null for none
Returns:
the future result of this operation

createChannelSource

TcpChannelSource createChannelSource(InetSocketAddress destination)
Create a channel source that always connects to the given TCP server.

Specified by:
createChannelSource in interface Connector<InetSocketAddress,TcpChannel>
Parameters:
destination - the destination to connect to
Returns:
the channel source

XNIO API 2.1.0.CR2

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