com.aelitis.azureus.core.networkmanager.impl.tcp
Class TCPConnectionManager
java.lang.Object
com.aelitis.azureus.core.networkmanager.impl.tcp.TCPConnectionManager
public class TCPConnectionManager
- extends Object
Manages new connection establishment and ended connection termination.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MAX_SIMULTANIOUS_CONNECT_ATTEMPTS
public static int MAX_SIMULTANIOUS_CONNECT_ATTEMPTS
TCPConnectionManager
public TCPConnectionManager()
getMaxOutboundPermitted
public int getMaxOutboundPermitted()
requestNewConnection
public void requestNewConnection(InetSocketAddress address,
TCPConnectionManager.ConnectListener listener,
int priority)
- Request that a new connection be made out to the given address.
- Parameters:
address
- remote ip+port to connect tolistener
- to receive notification of connect attempt success/failure
requestNewConnection
public void requestNewConnection(InetSocketAddress address,
TCPConnectionManager.ConnectListener listener,
int connect_timeout,
int priority)
closeConnection
public void closeConnection(SocketChannel channel)
- Close the given connection.
- Parameters:
channel
- to close
closeConnection
public void closeConnection(SocketChannel channel,
int delay)
cancelRequest
public void cancelRequest(TCPConnectionManager.ConnectListener listener_key)
- Cancel a pending new connection request.
- Parameters:
listener_key
- used in the initial connect request