org.gudy.azureus2.plugins.network
Interface Connection

All Known Implementing Classes:
ConnectionImpl

public interface Connection

Represents a managed peer connection, over which messages can be sent and received.


Method Summary
 void close()
          Close and shutdown this connection.
 void connect(ConnectionListener listener)
          Connect this connection's transport, i.e.
 IncomingMessageQueue getIncomingMessageQueue()
          Get the connection's incoming message queue.
 OutgoingMessageQueue getOutgoingMessageQueue()
          Get the connection's outgoing message queue.
 String getString()
          descriptive text for the connection
 Transport getTransport()
          Returns the transport object for this connection.
 boolean isIncoming()
          Returns true if the connection represents an incoming connection.
 void startMessageProcessing()
          Begin processing incoming and outgoing message queues.
 

Method Detail

connect

void connect(ConnectionListener listener)
Connect this connection's transport, i.e. establish the peer connection. If this connection is already established (from an incoming connection for example), then this provides a mechanism to register the connection listener, in which case connectSuccess() will be called immediately.

Parameters:
listener - notified on connect success or failure

close

void close()
Close and shutdown this connection.


getOutgoingMessageQueue

OutgoingMessageQueue getOutgoingMessageQueue()
Get the connection's outgoing message queue.

Returns:
outbound message queue

getIncomingMessageQueue

IncomingMessageQueue getIncomingMessageQueue()
Get the connection's incoming message queue.

Returns:
inbound message queue

startMessageProcessing

void startMessageProcessing()
Begin processing incoming and outgoing message queues.


getTransport

Transport getTransport()
Returns the transport object for this connection.

Since:
3.0.5.3

isIncoming

boolean isIncoming()
Returns true if the connection represents an incoming connection.

Since:
3.0.5.3

getString

String getString()
descriptive text for the connection

Returns: