Connection MethodsNetworkComms.Net Help
The Connection type exposes the following members.
Methods

  NameDescription
Public methodStatic memberAllExistingLocalListenEndPoints
Returns a dictionary corresponding to all current local listeners. Key is connection type, value is local EndPoint of listener.
Public methodStatic memberAllExistingLocalListeners
Returns a list of all local listeners
Public methodAppendIncomingPacketHandler incomingObjectType (String, NetworkComms PacketHandlerCallBackDelegate incomingObjectType )
Append a connection specific packet handler using the connection default SendReceiveOptions
Public methodAppendIncomingPacketHandler incomingObjectType (String, NetworkComms PacketHandlerCallBackDelegate incomingObjectType , SendReceiveOptions)
Append a connection specific packet handler
Public methodAppendIncomingUnmanagedPacketHandler
Append a connection specific unmanaged packet handler
Public methodAppendShutdownHandler
Add a connection specific shutdown delegate
Public methodCloseConnection
Closes the connection and trigger any associated shutdown delegates.
Protected methodCloseConnectionSpecific
Every connection will probably have to perform connection specific shutdown tasks. This is called before the global connection close tasks.
Public methodConnectionAlive 
Uses the current connection and returns a bool dependant on the remote end responding to a SendReceiveObject call within the default ConnectionAliveTestTimeoutMS
Public methodConnectionAlive(Int32)
Uses the current connection and returns a bool dependant on the remote end responding to a SendReceiveObject call within the provided aliveRespondTimeoutMS.
Public methodConnectionAlive(Int32, Int64 )
Uses the current connection and returns a bool dependant on the remote end responding to a SendReceiveObject call within the provided aliveRespondTimeoutMS
Protected methodConnectionHandshake
Performs a connection handshake with the remote end of the connection. Exchanges network identifier and any listener whose IPAddress matches the connection localEndPoint IPAddress.
Public methodDispose
Dispose of the connection. Recommended usage is to call CloseConnection instead.
Public methodOnlineEquals
Determines whether the specified OnlineObject is equal to the current OnlineObject.
(Inherited from OnlineObject.)
Public methodEstablishConnection
Establish this connection
Protected methodEstablishConnectionSpecific
Any connection type specific establish tasks. Should call at least ConnectionHandshake() or TriggerConnectionEstablishDelegates();
Public methodStatic memberExistingLocalListenEndPoints(ConnectionType)
Returns a list of OnlineEndPoints corresponding to possible local listeners of the provided ConnectionType. If no listeners exist returns empty list.
Public methodStatic memberExistingLocalListenEndPoints(ConnectionType, EndPoint)
Returns a list of OnlineEndPoint corresponding to possible local listeners of the provided ConnectionType with a local EndPoint with matching OnlineIPAddress. If no matching listeners exist returns empty list.
Public methodStatic memberExistingLocalListeners listenerType 
Returns a list of requested existing local listeners.
Protected methodOnlineFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from OnlineObject.)
Public methodOnlineGetHashCode
Serves as a hash function for a particular type.
(Inherited from OnlineObject.)
Public methodOnlineGetType
Gets the OnlineType of the current instance.
(Inherited from OnlineObject.)
Protected methodIncomingPacketHandleHandOff
Attempts to use the data provided in packetBuilder to recreate something useful. If we don't have enough data yet that value is set in packetBuilder.
Public methodIncomingPacketHandlerExists(String)
Returns true if an unmanaged packet handler exists on this connection
Public methodIncomingPacketHandlerExists(String, Delegate)
Returns true if the provided connection specific packet handler has been added for the provided packet type, on this connection.
Public methodIncomingUnmanagedPacketHandlerExists 
Returns true if a connection specific unmanaged packet handler exists, on this connection.
Public methodIncomingUnmanagedPacketHandlerExists(Delegate)
Returns true if the provided connection specific unmanaged packet handler has been added, on this connection.
Public methodStatic memberListening
Returns true if at least one local listener of the provided ConnectionType exists.
Protected methodOnlineMemberwiseClone
Creates a shallow copy of the current OnlineObject.
(Inherited from OnlineObject.)
Public methodPacketTypeUnwrapperOptions
Returns the packet type sendReceiveOptions possibly used to unwrap incoming data. If no specific options are registered returns null
Public methodRemoveIncomingPacketHandler 
Removes all packet handlers for all packet types, on this connection.
Public methodRemoveIncomingPacketHandler(String)
Removes all connection specific packet handlers for the provided packet type, on this connection.
Public methodRemoveIncomingPacketHandler(String, Delegate)
Remove the provided connection specific packet handler for the specified packet type, on this connection.
Public methodRemoveIncomingUnmanagedPacketHandler 
Removes all unmanaged packet handlers, on this connection.
Public methodRemoveIncomingUnmanagedPacketHandler(Delegate)
Remove the provided connection specific unmanaged packet handler, on this connection.
Public methodRemoveShutdownHandler
Remove a connection specific shutdown delegate.
Public methodSendObject(String)
Send an empty packet using the provided packetType. Useful for signalling.
Public methodSendObject(String, Int64 )
Send an empty packet using the provided packetType. Useful for signalling.
Public methodSendObject sendObjectType (String, sendObjectType)
Send an object using the connection default SendReceiveOptions
Public methodSendObject sendObjectType (String, sendObjectType, SendReceiveOptions)
Send an object using the provided SendReceiveOptions
Public methodSendObject sendObjectType (String, sendObjectType, Int64 )
Send an object using the connection default SendReceiveOptions
Public methodSendObject sendObjectType (String, sendObjectType, SendReceiveOptions, Int64 )
Send an object using the provided SendReceiveOptions
Public methodSendPacket packetPayloadObjectType (IPacket)
Send the provided packet to the remoteEndPoint. Waits for receive confirmation if required.
Public methodSendPacket packetPayloadObjectType (IPacket, Int64 )
Send the provided packet to the remoteEndPoint. Waits for receive confirmation if required.
Public methodSendReceiveObject returnObjectType (String, String, Int32)
Send an empty packet using the connection default SendReceiveOptions and wait for a returned object again using default SendReceiveOptions. Useful to request an object when there is no need to send anything.
Public methodSendReceiveObject returnObjectType (String, String, Int32, Int64 )
Send an empty packet using the connection default SendReceiveOptions and wait for a returned object again using default SendReceiveOptions. Usefull to request an object when there is no need to send anything.
Public methodSendReceiveObject sendObjectType, returnObjectType (String, String, Int32, sendObjectType)
Send an object using the connection default SendReceiveOptions and wait for a returned object again using default SendReceiveOptions.
Public methodSendReceiveObject sendObjectType, returnObjectType (String, String, Int32, sendObjectType, Int64 )
Send an object using the connection default SendReceiveOptions and wait for a returned object again using default SendReceiveOptions.
Public methodSendReceiveObject sendObjectType, returnObjectType (String, String, Int32, sendObjectType, SendReceiveOptions, SendReceiveOptions)
Send an object using the provided SendReceiveOptions and wait for a returned object using provided SendReceiveOptions.
Public methodSendReceiveObject sendObjectType, returnObjectType (String, String, Int32, sendObjectType, SendReceiveOptions, SendReceiveOptions, Int64 )
Send an object using the provided SendReceiveOptions and wait for a returned object using provided SendReceiveOptions.
Protected methodSendStreams
Connection specific implementation for sending data on this connection type. Each StreamSendWrapper[] represents a single expected packet.
Public methodSendUnmanagedBytes
Send bytes on an unmanaged connection
Protected methodStartIncomingDataListen
A connection specific method which triggers any requisites for accepting incoming data
Public methodStatic memberStartListening T (ConnectionListenerBase, T, Boolean)
Start listening for new incoming connections on specified OnlineIPEndPoint. Inspect listener.LocalListenIPEndPoint when method returns to determine the OnlineIPEndPoint used.
Public methodStatic memberStartListening T (List ConnectionListenerBase , List T , Boolean)
Start listening for new incoming connections on specified OnlineIPEndPoints. Listener is matched with desired localIPEndPoint based on List index. Inspect listener.LocalListenIPEndPoint when method returns to determine the OnlineIPEndPoints used.
Public methodStatic memberStartListening T (ConnectionType, T, Boolean)
Start listening for incoming connections of the provided ConnectionType. If the desired localEndPoint is not available will throw a CommsSetupShutdownException.
Public methodStatic memberStopListening 
Stops all local listeners
Public methodStatic memberStopListening(ConnectionListenerBase)
Stop listening for new incoming connections on specified ConnectionListenerBase and remove it from the local listeners dictionary.
Public methodStatic memberStopListening(List ConnectionListenerBase )
Stop listening for new incoming connections on specified list of ConnectionListenerBase and remove them from the local listeners dictionary.
Public methodStatic memberStopListening(ConnectionType)
Stops all local listeners of the provided ConnectionType.
Public methodStatic memberStopListening(ConnectionType, EndPoint)
Stop listening for new incoming connections on specified OnlineEndPoint and remove it from the local listeners dictionary.
Public methodToString
Returns ConnectionInfo.ToString
(Overrides OnlineObject ToString .)
Protected methodTriggerConnectionEstablishDelegates
Trigger connection establish delegates.
Protected methodStatic memberTriggerConnectionKeepAliveThread
Starts the connectionKeepAliveWorker thread if it is not already started
Public methodTriggerSpecificPacketHandlers
Trigger connection specific packet delegates with the provided parameters. Returns true if connection specific handlers were executed.
Protected methodWaitForConnectionEstablish
Return true if the connection is established within the provided timeout, otherwise false
Back to Top
See Also