Class ConnectionImpl
java.lang.Object
com.biglybt.pifimpl.local.network.ConnectionImpl
- All Implemented Interfaces:
Connection
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final NetworkConnection
private final IncomingMessageQueueImpl
private final boolean
private final OutgoingMessageQueueImpl
private final TransportImpl
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close and shutdown this connection.void
connect
(ConnectionListener listener) Connect this connection's transport, i.e.Get the connection's incoming message queue.Get the connection's outgoing message queue.descriptive text for the connectionReturns the transport object for this connection.boolean
Returns true if the connection represents an incoming connection.void
Begin processing incoming and outgoing message queues.
-
Field Details
-
core_connection
-
out_queue
-
in_queue
-
transport
-
incoming
private final boolean incoming
-
-
Constructor Details
-
ConnectionImpl
-
-
Method Details
-
connect
Description copied from interface:Connection
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.- Specified by:
connect
in interfaceConnection
- Parameters:
listener
- notified on connect success or failure
-
close
public void close()Description copied from interface:Connection
Close and shutdown this connection.- Specified by:
close
in interfaceConnection
-
getOutgoingMessageQueue
Description copied from interface:Connection
Get the connection's outgoing message queue.- Specified by:
getOutgoingMessageQueue
in interfaceConnection
- Returns:
- outbound message queue
-
getIncomingMessageQueue
Description copied from interface:Connection
Get the connection's incoming message queue.- Specified by:
getIncomingMessageQueue
in interfaceConnection
- Returns:
- inbound message queue
-
startMessageProcessing
public void startMessageProcessing()Description copied from interface:Connection
Begin processing incoming and outgoing message queues.- Specified by:
startMessageProcessing
in interfaceConnection
-
getTransport
Description copied from interface:Connection
Returns the transport object for this connection.- Specified by:
getTransport
in interfaceConnection
-
getCoreConnection
-
isIncoming
public boolean isIncoming()Description copied from interface:Connection
Returns true if the connection represents an incoming connection.- Specified by:
isIncoming
in interfaceConnection
-
getString
Description copied from interface:Connection
descriptive text for the connection- Specified by:
getString
in interfaceConnection
- Returns:
-