Class ConnectionImpl
java.lang.Object
com.biglybt.pifimpl.local.network.ConnectionImpl
- All Implemented Interfaces:
Connection
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final NetworkConnectionprivate final IncomingMessageQueueImplprivate final booleanprivate final OutgoingMessageQueueImplprivate final TransportImpl -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close and shutdown this connection.voidconnect(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.booleanReturns true if the connection represents an incoming connection.voidBegin 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:ConnectionConnect 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:
connectin interfaceConnection- Parameters:
listener- notified on connect success or failure
-
close
public void close()Description copied from interface:ConnectionClose and shutdown this connection.- Specified by:
closein interfaceConnection
-
getOutgoingMessageQueue
Description copied from interface:ConnectionGet the connection's outgoing message queue.- Specified by:
getOutgoingMessageQueuein interfaceConnection- Returns:
- outbound message queue
-
getIncomingMessageQueue
Description copied from interface:ConnectionGet the connection's incoming message queue.- Specified by:
getIncomingMessageQueuein interfaceConnection- Returns:
- inbound message queue
-
startMessageProcessing
public void startMessageProcessing()Description copied from interface:ConnectionBegin processing incoming and outgoing message queues.- Specified by:
startMessageProcessingin interfaceConnection
-
getTransport
Description copied from interface:ConnectionReturns the transport object for this connection.- Specified by:
getTransportin interfaceConnection
-
getCoreConnection
-
isIncoming
public boolean isIncoming()Description copied from interface:ConnectionReturns true if the connection represents an incoming connection.- Specified by:
isIncomingin interfaceConnection
-
getString
Description copied from interface:Connectiondescriptive text for the connection- Specified by:
getStringin interfaceConnection- Returns:
-