The Connection type exposes the following members.
Back to Top
Back to Top
Back to Top
Back to Top
Constructors
Name | Description | |
---|---|---|
Connection |
Create a new connection object
|
Methods
Name | Description | |
---|---|---|
AllExistingLocalListenEndPoints |
Returns a dictionary corresponding to all current local listeners. Key is connection type, value is local EndPoint of listener.
| |
AllExistingLocalListeners |
Returns a list of all local listeners
| |
AppendIncomingPacketHandler incomingObjectType (String, NetworkComms PacketHandlerCallBackDelegate incomingObjectType ) |
Append a connection specific packet handler using the connection default SendReceiveOptions
| |
AppendIncomingPacketHandler incomingObjectType (String, NetworkComms PacketHandlerCallBackDelegate incomingObjectType , SendReceiveOptions) |
Append a connection specific packet handler
| |
AppendIncomingUnmanagedPacketHandler |
Append a connection specific unmanaged packet handler
| |
AppendShutdownHandler |
Add a connection specific shutdown delegate
| |
CloseConnection |
Closes the connection and trigger any associated shutdown delegates.
| |
CloseConnectionSpecific |
Every connection will probably have to perform connection specific shutdown tasks. This is called before the global
connection close tasks.
| |
ConnectionAlive |
Uses the current connection and returns a bool dependant on the remote end responding to a SendReceiveObject call
within the default ConnectionAliveTestTimeoutMS | |
ConnectionAlive(Int32) |
Uses the current connection and returns a bool dependant on the remote end responding to a SendReceiveObject call
within the provided aliveRespondTimeoutMS.
| |
ConnectionAlive(Int32, Int64 ) |
Uses the current connection and returns a bool dependant on the remote end responding to a SendReceiveObject call
within the provided aliveRespondTimeoutMS
| |
ConnectionHandshake |
Performs a connection handshake with the remote end of the connection.
Exchanges network identifier and any listener whose IPAddress matches the connection localEndPoint IPAddress.
| |
Dispose |
Dispose of the connection. Recommended usage is to call CloseConnection instead.
| |
Equals | (Inherited from Object.) | |
EstablishConnection |
Establish this connection
| |
EstablishConnectionSpecific |
Any connection type specific establish tasks. Should call at least ConnectionHandshake() or TriggerConnectionEstablishDelegates();
| |
ExistingLocalListenEndPoints(ConnectionType) |
Returns a list of EndPoints corresponding to possible local listeners of the provided
ConnectionType. If no listeners exist returns empty list.
| |
ExistingLocalListenEndPoints(ConnectionType, EndPoint) |
Returns a list of EndPoint corresponding to possible local listeners of the provided
ConnectionType with a local EndPoint with matching IPAddress.
If no matching listeners exist returns empty list.
| |
ExistingLocalListeners listenerType |
Returns a list of requested existing local listeners.
| |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
IncomingPacketHandleHandOff |
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.
| |
IncomingPacketHandlerExists(String) |
Returns true if an unmanaged packet handler exists on this connection
| |
IncomingPacketHandlerExists(String, Delegate) |
Returns true if the provided connection specific packet handler has been added for the provided packet type, on this connection.
| |
IncomingUnmanagedPacketHandlerExists |
Returns true if a connection specific unmanaged packet handler exists, on this connection.
| |
IncomingUnmanagedPacketHandlerExists(Delegate) |
Returns true if the provided connection specific unmanaged packet handler has been added, on this connection.
| |
Listening |
Returns true if at least one local listener of the provided ConnectionType exists.
| |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
PacketTypeUnwrapperOptions |
Returns the packet type sendReceiveOptions possibly used to unwrap incoming data. If no specific options are registered returns null
| |
RemoveIncomingPacketHandler |
Removes all packet handlers for all packet types, on this connection.
| |
RemoveIncomingPacketHandler(String) |
Removes all connection specific packet handlers for the provided packet type, on this connection.
| |
RemoveIncomingPacketHandler(String, Delegate) |
Remove the provided connection specific packet handler for the specified packet type, on this connection.
| |
RemoveIncomingUnmanagedPacketHandler |
Removes all unmanaged packet handlers, on this connection.
| |
RemoveIncomingUnmanagedPacketHandler(Delegate) |
Remove the provided connection specific unmanaged packet handler, on this connection.
| |
RemoveShutdownHandler |
Remove a connection specific shutdown delegate.
| |
SendObject(String) |
Send an empty packet using the provided packetType. Useful for signalling.
| |
SendObject(String, Int64 ) |
Send an empty packet using the provided packetType. Useful for signalling.
| |
SendObject sendObjectType (String, sendObjectType) |
Send an object using the connection default SendReceiveOptions | |
SendObject sendObjectType (String, sendObjectType, SendReceiveOptions) |
Send an object using the provided SendReceiveOptions
| |
SendObject sendObjectType (String, sendObjectType, Int64 ) |
Send an object using the connection default SendReceiveOptions | |
SendObject sendObjectType (String, sendObjectType, SendReceiveOptions, Int64 ) |
Send an object using the provided SendReceiveOptions
| |
SendPacket packetPayloadObjectType (IPacket) |
Send the provided packet to the remoteEndPoint. Waits for receive confirmation if required.
| |
SendPacket packetPayloadObjectType (IPacket, Int64 ) |
Send the provided packet to the remoteEndPoint. Waits for receive confirmation if required.
| |
SendReceiveObject 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.
| |
SendReceiveObject 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.
| |
SendReceiveObject sendObjectType, returnObjectType (String, String, Int32, sendObjectType) |
Send an object using the connection default SendReceiveOptions and wait for a returned object
again using default SendReceiveOptions.
| |
SendReceiveObject 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.
| |
SendReceiveObject sendObjectType, returnObjectType (String, String, Int32, sendObjectType, SendReceiveOptions, SendReceiveOptions) |
Send an object using the provided SendReceiveOptions and wait for a returned object using provided
SendReceiveOptions.
| |
SendReceiveObject 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.
| |
SendStreams |
Connection specific implementation for sending data on this connection type.
Each StreamSendWrapper[] represents a single expected packet.
| |
SendUnmanagedBytes |
Send bytes on an unmanaged connection
| |
StartIncomingDataListen |
A connection specific method which triggers any requisites for accepting incoming data
| |
StartListening T (ConnectionListenerBase, T, Boolean) |
Start listening for new incoming connections on specified IPEndPoint. Inspect listener.LocalListenIPEndPoint
when method returns to determine the IPEndPoint used.
| |
StartListening T (List ConnectionListenerBase , List T , Boolean) |
Start listening for new incoming connections on specified IPEndPoints. Listener is matched
with desired localIPEndPoint based on List index. Inspect listener.LocalListenIPEndPoint
when method returns to determine the IPEndPoints used.
| |
StartListening T (ConnectionType, T, Boolean) |
Start listening for incoming connections of the provided ConnectionType.
If the desired localEndPoint is not available will throw a CommsSetupShutdownException.
| |
StopListening |
Stops all local listeners
| |
StopListening(ConnectionListenerBase) |
Stop listening for new incoming connections on specified ConnectionListenerBase and remove it from the local listeners dictionary.
| |
StopListening(List ConnectionListenerBase ) |
Stop listening for new incoming connections on specified list of ConnectionListenerBase and remove them from the local listeners dictionary.
| |
StopListening(ConnectionType) |
Stops all local listeners of the provided ConnectionType.
| |
StopListening(ConnectionType, EndPoint) |
Stop listening for new incoming connections on specified EndPoint and remove it from the local listeners dictionary.
| |
ToString |
Returns ConnectionInfo.ToString
(Overrides Object ToString .) | |
TriggerConnectionEstablishDelegates |
Trigger connection establish delegates.
| |
TriggerConnectionKeepAliveThread |
Starts the connectionKeepAliveWorker thread if it is not already started
| |
TriggerSpecificPacketHandlers |
Trigger connection specific packet delegates with the provided parameters. Returns true if connection specific handlers were executed.
| |
WaitForConnectionEstablish |
Return true if the connection is established within the provided timeout, otherwise false
|
Fields
Name | Description | |
---|---|---|
asyncListenerInRead |
True if the async listen method is in a beginRead
| |
asyncListenStarted |
True if async listen has started
| |
connectionEstablishWait |
A manual reset event which can be used to handle connection setup and establish.
| |
connectionSetupException |
A boolean used to signal a connection setup exception.
| |
connectionSetupExceptionStr |
If connectionSetupException is true provides additional exception information.
| |
connectionSetupWait |
A manual reset event which can be used to handle connection setup and establish.
| |
incomingDataListenThread |
The thread listening for incoming data should we be using synchronous methods.
| |
packetBuilder |
The PacketBuilder for this connection
| |
packetSequenceCounter |
A counter which is incremented during every a send. The current value is included in the header of all sent packets.
| |
sendLocker |
Lockers for maintaining thread safe operation
| |
SendTimesMSPerKBCache |
A NetworkComms.Net math object for tracking send times. Used to prevent send deadlocks.
Initialised at 1000 milliseconds per KB write speed, corresponding with 1KB / second.
| |
totalBytesRead |
The total bytes read so far within dataBuffer
|
Properties
Name | Description | |
---|---|---|
ConnectionDefaultSendReceiveOptions |
The default SendReceiveOptions used for this connection
| |
ConnectionInfo |
Connection information related to this connection.
| |
ConnectionKeepAlivePollIntervalSecs |
The interval between keep alive polls of all connections. Set to int.MaxValue to disable keep alive poll
| |
DefaultMSPerKBSendTimeout |
The default milliseconds per KB write timeout before connection specific values become available. Default is 1000. See MinNumSendsBeforeConnectionSpecificSendTimeout.
| |
MaxNumSendTimes |
The maximum number of writes intervals to maintain. Default is 100.
| |
MinimumMSPerKBSendTimeout |
The minimum number of milliseconds to allow per KB before a write timeout may occur. Default is 20.0.
| |
MinNumSendsBeforeConnectionSpecificSendTimeout |
The minimum number of writes before the connection specific write timeouts will be used. Default is 4.
| |
MinSendTimeoutMS |
The minimum timeout for any sized send in milliseconds. Prevents timeouts when sending less than 1KB. Default is 2000.
| |
NumberOfStDeviationsForWriteTimeout |
The number of standard deviations from the mean to use for write timeouts. Default is 3.0.
| |
SyncRoot |
Connection level SyncRoot which can be used to perform multiple thread safe operations on this connection
external to NetworkComms.Net
|
See Also