The NetworkComms type exposes the following members.
Back to Top
Back to Top
Back to Top
Methods
Name | Description | |
---|---|---|
AllConnectionInfo(Boolean) |
Returns a ConnectionInfo array containing information for all connections
| |
AllConnectionInfo(ShortGuid, Boolean) |
Returns a ConnectionInfo array containing information for all connections which have the provided networkIdentifier.
It is also possible to include information for closed connections.
| |
AppendGlobalConnectionCloseHandler |
Add a new connection shutdown delegate which will be called for every connection as it is closes.
| |
AppendGlobalConnectionEstablishHandler |
Add a new connection establish delegate which will be called for every connection once it has been successfully established.
| |
AppendGlobalIncomingPacketHandler incomingObjectType (String, NetworkComms PacketHandlerCallBackDelegate incomingObjectType ) |
Add an incoming packet handler using default SendReceiveOptions. Multiple handlers for the same packet type will be
executed in the order they are added.
| |
AppendGlobalIncomingPacketHandler incomingObjectType (String, NetworkComms PacketHandlerCallBackDelegate incomingObjectType , SendReceiveOptions) |
Add an incoming packet handler using the provided SendReceiveOptions. Multiple handlers for the same packet type will be executed in the order they are added.
| |
AppendGlobalIncomingUnmanagedPacketHandler |
Add an incoming packet handler for unmanaged packets. Multiple handlers will be executed in the order they are added.
| |
CloseAllConnections |
Close all connections
| |
CloseAllConnections(ConnectionType) |
Close all connections of the provided ConnectionType | |
CloseAllConnections(ConnectionType, EndPoint ) |
Close all connections of the provided ConnectionType except to provided EndPoint array.
| |
ConnectionExists(ConnectionInfo) |
Check if a connection with the provided ConnectionInfo exists. Internally matches connection based on IPEndPoint, ConnectionType,
NetworkIdentifier and ApplicationLayerProtocol status.
| |
ConnectionExists(ShortGuid, ConnectionType, ApplicationLayerProtocolStatus) |
Check if a connection exists with the provided parameters.
| |
ConnectionExists(EndPoint, EndPoint, ConnectionType, ApplicationLayerProtocolStatus) |
Check if a connection exists with the provided parameters.
| |
DisableLogging |
Disable all logging in NetworkCommsDotNet
| |
EnableLogging |
Enable logging using a default config. All log output is written directly to the local console.
| |
EnableLogging(ILogger) |
Enable logging using the provided config. See examples for usage.
| |
GetExistingConnection(ApplicationLayerProtocolStatus) |
Returns a list of all connections which match the provided parameters. If no parameter are provided returns all connections.
| |
GetExistingConnection(ConnectionInfo) |
Retrieve an existing connection with the provided ConnectionInfo. Internally matches connection based on IPEndPoint, ConnectionType,
NetworkIdentifier and ApplicationLayerProtocol status.
| |
GetExistingConnection(ConnectionType, ApplicationLayerProtocolStatus) |
Returns a list of all connections matching the provided parameters.
| |
GetExistingConnection(ShortGuid, ConnectionType, ApplicationLayerProtocolStatus) |
Returns a list of all connections matching the provided parameters.
| |
GetExistingConnection(EndPoint, EndPoint, ConnectionType, ApplicationLayerProtocolStatus) |
Returns a list of all connections matching the provided parameters.
| |
GlobalIncomingPacketHandlerExists(String) |
Returns true if a global packet handler exists for the provided packet type.
| |
GlobalIncomingPacketHandlerExists packetHandlerIncomingObjectType (String, NetworkComms PacketHandlerCallBackDelegate packetHandlerIncomingObjectType ) |
Returns true if the provided global packet handler has been added for the provided packet type.
| |
GlobalIncomingUnmanagedPacketHandlerExists |
Returns true if a global unmanaged packet handler exists
| |
GlobalIncomingUnmanagedPacketHandlerExists packetHandlerIncomingObjectType (NetworkComms PacketHandlerCallBackDelegate packetHandlerIncomingObjectType ) |
Returns true if the provided global unmanaged packet handler has been added.
| |
GlobalPacketTypeUnwrapperOptions |
Returns the unwrapper SendReceiveOptions for the provided packet type. If no specific options are registered returns null.
| |
RemoveGlobalConnectionCloseHandler |
Remove a connection shutdown delegate.
| |
RemoveGlobalConnectionEstablishHandler |
Remove a connection establish delegate.
| |
RemoveGlobalIncomingPacketHandler |
Removes all delegates for all packet types
| |
RemoveGlobalIncomingPacketHandler(String) |
Removes all delegates for the provided packet type.
| |
RemoveGlobalIncomingPacketHandler packetHandlerIncomingObjectType (String, NetworkComms PacketHandlerCallBackDelegate packetHandlerIncomingObjectType ) |
Removes the provided delegate for the specified packet type. If the provided delegate does not exist for this packet type just returns.
| |
RemoveGlobalIncomingUnmanagedPacketHandler |
Removes all unmanaged packet handlers.
| |
RemoveGlobalIncomingUnmanagedPacketHandler packetHandlerIncomingObjectType (NetworkComms PacketHandlerCallBackDelegate packetHandlerIncomingObjectType ) |
Removes the provided delegate for unmanaged packet types. If the provided delegate does not exist for this packet type just returns.
| |
SendObject sendObjectType |
Send the provided object to the specified destination using TCP. Uses default sendReceiveOptions. For more control over
options see connection specific methods.
| |
SendReceiveObject sendObjectType, returnObjectType |
Send the provided object to the specified destination and wait for a return object using TCP. Uses default sendReceiveOptions.
For more control over options see connection specific methods.
| |
Shutdown |
Shutdown all connections, threads and execute OnCommsShutdown event. Any packet handlers are left unchanged. If any network
activity has taken place this should be called on application close.
| |
TotalNumConnections |
Returns the total number of connections
| |
TotalNumConnections(IPAddress) |
Returns the total number of connections where the RemoteEndPoint matches the provided
IPAddress | |
TriggerGlobalPacketHandlers(PacketHeader, Connection, MemoryStream, SendReceiveOptions) |
Trigger incoming packet delegates for the provided parameters.
| |
TriggerGlobalPacketHandlers(PacketHeader, Connection, MemoryStream, SendReceiveOptions, Boolean) |
Trigger incoming packet delegates for the provided parameters.
|
Properties
Name | Description | |
---|---|---|
CheckSumMismatchSentPacketCacheMaxByteLimit |
When checksum validation is enabled sets the limit below which sent packets are cached to ensure successful delivery. Default 75KB.
| |
CommsThreadPool |
The thread pool used by networkComms.Net to execute incoming packet handlers.
| |
ConnectionAliveTestTimeoutMS |
Time to wait in milliseconds before assuming a remote connection is dead when doing a connection test. Default is 1000.
| |
ConnectionEstablishTimeoutMS |
Time to wait in milliseconds before throwing an exception when waiting for a connection to be established. Default is 30000.
| |
ConnectionListenModeUseSync |
Used for switching between async and sync connectionListen modes. Default is false. No noticeable performance difference
between the two modes.
| |
CurrentRuntimeEnvironment |
The current runtime environment. Detected automatically on start up. Performance may be adversely affected if this is changed.
| |
DefaultSendReceiveOptions |
Default options for sending and receiving in the absence of specific values
| |
DisableConnectionSendTimeouts |
By default NetworkComms.Net closes connections for which sends take a long time. The timeout is calculated based on previous connection send performances. Set this to true to disable this feature.
| |
EnablePacketCheckSumValidation |
When enabled uses an MD5 checksum to validate all received packets. Default is false, relying on any possible connection
checksum alone. Also when enabled any packets sent less than CheckSumMismatchSentPacketCacheMaxByteLimit will be cached
for a duration to ensure successful delivery. Default false.
| |
IgnoreUnknownPacketTypes |
If true any unknown incoming packet types are ignored. Default is false and will result in an error file being created if
an unknown packet type is received.
| |
InitialReceiveBufferSizeBytes |
Initial receive data buffer size for reading data. Keeping this small reduces the static size of connection objects which each have an internal buffer. Default is 512 bytes. CAUTION: Changing the default value can lead to performance degradation.
| |
Logger |
Access the NetworkCommsDotNet logger externally.
| |
LoggingEnabled |
Returns true if NetworkComms.Net logging has been enabled.
| |
MaxReceiveBufferSizeBytes |
Maximum data buffer size that will be allocated for reading. Default is 80KB. CAUTION: Changing the default value can lead to performance degradation.
| |
MinimumSentPacketCacheTimeMinutes |
When a sent packet has been cached for a possible resend this is the minimum length of time it will be retained.
Default is 1.0 minutes.
| |
NetworkIdentifier |
The local identifier for this instance of NetworkCommsDotNet. This is an application unique identifier.
| |
PacketConfirmationTimeoutMS |
Time to wait in milliseconds before throwing an exception when waiting for confirmation of packet receipt. Default is 5000.
| |
SendBufferSizeBytes |
Send data buffer size. Default is 80KB. CAUTION: Changing the default value can lead to performance degradation.
|
Events
Name | Description | |
---|---|---|
OnCommsShutdown |
Comms shutdown event. This will be triggered when calling NetworkComms.Shutdown
|
See Also