UDPConnection MembersNetworkComms.Net Help
The UDPConnection type exposes the following members.
Methods

  NameDescription
Public methodAppendIncomingPacketHandler incomingObjectType (String, NetworkComms PacketHandlerCallBackDelegate incomingObjectType )
Append a connection specific packet handler using the connection default SendReceiveOptions
(Inherited from Connection.)
Public methodAppendIncomingPacketHandler incomingObjectType (String, NetworkComms PacketHandlerCallBackDelegate incomingObjectType , SendReceiveOptions)
Append a connection specific packet handler
(Inherited from Connection.)
Public methodAppendIncomingUnmanagedPacketHandler
Append a connection specific unmanaged packet handler
(Inherited from Connection.)
Public methodAppendShutdownHandler
Add a connection specific shutdown delegate
(Inherited from Connection.)
Public methodCloseConnection
Closes the connection and trigger any associated shutdown delegates.
(Inherited from Connection.)
Protected methodCloseConnectionSpecific
Every connection will probably have to perform connection specific shutdown tasks. This is called before the global connection close tasks.
(Overrides Connection CloseConnectionSpecific(Boolean, Int32).)
Public methodConnectionAlive 
Uses the current connection and returns a bool dependant on the remote end responding to a SendReceiveObject call within the default ConnectionAliveTestTimeoutMS
(Inherited from Connection.)
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.
(Inherited from Connection.)
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
(Inherited from Connection.)
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.
(Inherited from Connection.)
Public methodDispose
Dispose of the connection. Recommended usage is to call CloseConnection instead.
(Inherited from Connection.)
Public methodOnlineEquals
Determines whether the specified OnlineObject is equal to the current OnlineObject.
(Inherited from OnlineObject.)
Public methodEstablishConnection
Establish this connection
(Inherited from Connection.)
Protected methodEstablishConnectionSpecific
Any connection type specific establish tasks. Should call at least ConnectionHandshake() or TriggerConnectionEstablishDelegates();
(Overrides Connection EstablishConnectionSpecific .)
Public methodStatic memberExistingLocalListenEndPoints Obsolete.
Returns a list of OnlineIPEndPoint corresponding with all UDP local listeners
Public methodStatic memberExistingLocalListenEndPoints(IPAddress)Obsolete.
Returns an OnlineIPEndPoint corresponding to a possible local listener on the provided OnlineIPAddress. If not listening on provided OnlineIPAddress returns null.
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 methodStatic memberGetConnection(ConnectionInfo, UDPOptions, Boolean, Boolean)
Create a UDP connection with the provided connectionInfo. If there is an existing connection that is returned instead. If a new connection is created it will be registered with NetworkComms and can be retrieved using GetExistingConnection(ConnectionInfo) and overrides.
Public methodStatic memberGetConnection(ConnectionInfo, UDPOptions, SendReceiveOptions, Boolean, Boolean)
Create a UDP connection with the provided connectionInfo and and sets the connection default SendReceiveOptions. If there is an existing connection that is returned instead. If a new connection is created it will be registered with NetworkComms and can be retrieved using GetExistingConnection(ConnectionInfo).
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.
(Inherited from Connection.)
Public methodIncomingPacketHandlerExists(String)
Returns true if an unmanaged packet handler exists on this connection
(Inherited from 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.
(Inherited from Connection.)
Public methodIncomingUnmanagedPacketHandlerExists 
Returns true if a connection specific unmanaged packet handler exists, on this connection.
(Inherited from Connection.)
Public methodIncomingUnmanagedPacketHandlerExists(Delegate)
Returns true if the provided connection specific unmanaged packet handler has been added, on this connection.
(Inherited from Connection.)
Public methodStatic memberListeningObsolete.
Returns true if listening for new UDP connections.
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
(Inherited from Connection.)
Public methodRemoveIncomingPacketHandler 
Removes all packet handlers for all packet types, on this connection.
(Inherited from Connection.)
Public methodRemoveIncomingPacketHandler(String)
Removes all connection specific packet handlers for the provided packet type, on this connection.
(Inherited from Connection.)
Public methodRemoveIncomingPacketHandler(String, Delegate)
Remove the provided connection specific packet handler for the specified packet type, on this connection.
(Inherited from Connection.)
Public methodRemoveIncomingUnmanagedPacketHandler 
Removes all unmanaged packet handlers, on this connection.
(Inherited from Connection.)
Public methodRemoveIncomingUnmanagedPacketHandler(Delegate)
Remove the provided connection specific unmanaged packet handler, on this connection.
(Inherited from Connection.)
Public methodRemoveShutdownHandler
Remove a connection specific shutdown delegate.
(Inherited from Connection.)
Public methodSendObject(String)
Send an empty packet using the provided packetType. Useful for signalling.
(Inherited from Connection.)
Public methodSendObject(String, Int64 )
Send an empty packet using the provided packetType. Useful for signalling.
(Inherited from Connection.)
Public methodStatic memberSendObject(String, Object, IPEndPoint)
Sends a single object to the provided endPoint. NOTE: Any possible reply will be ignored unless listening for incoming UDP packets.
Public methodStatic memberSendObject(String, Object, IPEndPoint, SendReceiveOptions)
Sends a single object to the provided endPoint. NOTE: Any possible reply will be ignored unless listening for incoming UDP packets.
Public methodStatic memberSendObject(String, Object, String, Int32)
Sends a single object to the provided IPAddress and Port. NOTE: Any possible reply will be ignored unless listening for incoming UDP packets.
Public methodSendObject sendObjectType (String, sendObjectType)
Send an object using the connection default SendReceiveOptions
(Inherited from Connection.)
Public methodSendObject sendObjectType (String, sendObjectType, SendReceiveOptions)
Send an object using the provided SendReceiveOptions
(Inherited from Connection.)
Public methodSendObject sendObjectType (String, sendObjectType, Int64 )
Send an object using the connection default SendReceiveOptions
(Inherited from Connection.)
Public methodSendObject sendObjectType (String, sendObjectType, SendReceiveOptions, Int64 )
Send an object using the provided SendReceiveOptions
(Inherited from Connection.)
Public methodStatic memberSendObject packetPayloadObjectType (IPacket, IPEndPoint, SendReceiveOptions, ApplicationLayerProtocolStatus)
Sends a Packet to the provided endPoint. Offers more performance if an identical packet is being sent to multiple peers. NOTE: Any possible reply will be ignored unless listening for incoming UDP packets.
Public methodStatic memberSendObject sendObjectType (String, sendObjectType, IPEndPoint, SendReceiveOptions, ApplicationLayerProtocolStatus)
Sends a single object to the provided endPoint. NOTE: Any possible reply will be ignored unless listening for incoming UDP packets.
Public methodSendPacket packetPayloadObjectType (IPacket)
Send the provided packet to the remoteEndPoint. Waits for receive confirmation if required.
(Inherited from Connection.)
Public methodSendPacket packetPayloadObjectType (IPacket, Int64 )
Send the provided packet to the remoteEndPoint. Waits for receive confirmation if required.
(Inherited from Connection.)
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.
(Inherited from Connection.)
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.
(Inherited from Connection.)
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.
(Inherited from Connection.)
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.
(Inherited from Connection.)
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.
(Inherited from Connection.)
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.
(Inherited from Connection.)
Protected methodSendStreams
Connection specific implementation for sending data on this connection type. Each StreamSendWrapper[] represents a single expected packet.
(Overrides Connection SendStreams( StreamTools StreamSendWrapper , Double, Int64).)
Public methodSendUnmanagedBytes
Send bytes on an unmanaged connection
(Inherited from Connection.)
Protected methodStartIncomingDataListen
A connection specific method which triggers any requisites for accepting incoming data
(Overrides Connection StartIncomingDataListen .)
Public methodStatic memberStartListening(Boolean)Obsolete.
Listen for incoming UDP packets on all allowed local IP's on default port.
Public methodStatic memberStartListening(List IPEndPoint , Boolean)Obsolete.
Listen for incoming UDP packets on provided list of OnlineIPEndPoint.
Public methodStatic memberStartListening(IPEndPoint, Boolean, Boolean)Obsolete.
Listen for incoming UDP packets on specified OnlineIPEndPoint.
Public methodToString
Returns ConnectionInfo.ToString
(Inherited from Connection.)
Protected methodTriggerConnectionEstablishDelegates
Trigger connection establish delegates.
(Inherited from Connection.)
Public methodTriggerSpecificPacketHandlers
Trigger connection specific packet delegates with the provided parameters. Returns true if connection specific handlers were executed.
(Inherited from Connection.)
Protected methodWaitForConnectionEstablish
Return true if the connection is established within the provided timeout, otherwise false
(Inherited from Connection.)
Back to Top
Fields

  NameDescription
Protected fieldasyncListenerInRead
True if the async listen method is in a beginRead
(Inherited from Connection.)
Protected fieldasyncListenStarted
True if async listen has started
(Inherited from Connection.)
Protected fieldconnectionEstablishWait
A manual reset event which can be used to handle connection setup and establish.
(Inherited from Connection.)
Protected fieldconnectionSetupException
A boolean used to signal a connection setup exception.
(Inherited from Connection.)
Protected fieldconnectionSetupExceptionStr
If connectionSetupException is true provides additional exception information.
(Inherited from Connection.)
Protected fieldconnectionSetupWait
A manual reset event which can be used to handle connection setup and establish.
(Inherited from Connection.)
Protected fieldincomingDataListenThread
The thread listening for incoming data should we be using synchronous methods.
(Inherited from Connection.)
Protected fieldpacketBuilder
The PacketBuilder for this connection
(Inherited from Connection.)
Protected fieldpacketSequenceCounter
A counter which is incremented during every a send. The current value is included in the header of all sent packets.
(Inherited from Connection.)
Protected fieldsendLocker
Lockers for maintaining thread safe operation
(Inherited from Connection.)
Protected fieldSendTimesMSPerKBCache
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.
(Inherited from Connection.)
Protected fieldtotalBytesRead
The total bytes read so far within dataBuffer
(Inherited from Connection.)
Back to Top
Properties

  NameDescription
Public propertyConnectionDefaultSendReceiveOptions
The default SendReceiveOptions used for this connection
(Inherited from Connection.)
Public propertyConnectionInfo
Connection information related to this connection.
(Inherited from Connection.)
Public propertyConnectionUDPOptions
Options associated with this UDPConnection
Public propertyStatic memberDefaultUDPOptions
The default UDPOptions to use where none are otherwise specified.
Public propertyStatic memberIgnoreICMPDestinationUnreachable
By default a UDP datagram sent to an unreachable destination will result in an ICMP Destination Unreachable packet. This can result in a SocketException on the local end. To avoid this behaviour these ICMP packets are ignored by default, i.e. this value is set to true. Setting this value to false could cause new UDP connections to close, possibly unexpectedly.
Public propertySyncRoot
Connection level SyncRoot which can be used to perform multiple thread safe operations on this connection external to NetworkComms.Net
(Inherited from Connection.)
Back to Top
See Also