XNIO API 2.0.2.GA

org.jboss.xnio
Interface TcpConnector

All Superinterfaces:
Connector<java.net.InetSocketAddress,TcpChannel>

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

A connector specifically for connecting to TCP servers.


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

Method Detail

connectTo

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

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

createChannelSource

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

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

XNIO API 2.0.2.GA

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