Halyri - Udp-client  0.9.1
 All Classes Namespaces Functions Enumerations Properties
UdpMediaClientSocket Class Reference

Client socket implementing a simple UDP-based media transfer protocol. Delivery of packets is not guaranteed. Sent packets are split to conform to the specified MTU. The underlaying IP checksum is relied upon for the integrity of the packets. Constant ping packets are employed to monitor the connection and to keep the UDP packets routed in both directions by the network channel. More...

Public Member Functions

 UdpMediaClientSocket (string serverIpAddress, int serverPort, int localPort, string clientGuid, int networkMtu, int timeOutMillis)
 Initializes a new UdpMediaClientSocket to connect to the specified host. The provided GUID is used for identifying this client during the connection. The socket is not connected before a call to the Connect method. The socket will use the specified MTU on the network packets. The underlying UDP socket will use the specified port at the local system. More...
 
 UdpMediaClientSocket (string serverIpAddress, int serverPort, int localPort, string clientGuid, int networkMtu)
 Initializes a new UdpMediaClientSocket to connect to the specified host. The provided GUID is used for identifying this client during the connection. The socket is not connected before a call to the Connect method. The socket will use the specified MTU on the network packets. The underlying UDP socket will use the specified port at the local system. More...
 
 UdpMediaClientSocket (string serverIpAddress, int serverPort, string clientGuid, int networkMtu)
 Initializes a new UdpMediaClientSocket to connect to the specified host. The provided GUID is used for identifying this client during the connection. The socket is not connected before a call to the Connect method. The socket will use the specified MTU on the network packets. More...
 
 UdpMediaClientSocket (string serverIpAddress, int serverPort, string clientGuid)
 Initializes a new UdpMediaClientSocket to connect to the specified host. The provided GUID is used for identifying this client during the connection. The socket is not connected before a call to the Connect method. The socket will use a default MTU of 1024 bytes on the network. More...
 
 UdpMediaClientSocket (int pingLossLimit, string serverIpAddress, int serverPort, string clientGuid)
 Initializes a new UdpMediaClientSocket to connect to the specified host. The provided GUID is used for identifying this client during the connection. The socket is not connected before a call to the Connect method. The socket will use a default MTU of 1024 bytes on the network. More...
 
void Disconnect ()
 Disconnets a connected instance. More...
 
void Connect ()
 Connects a non-connected instance. This method needs to be called prior to any send operations for them to succeed. More...
 
bool SendMedia (MediaInformation mediaInfo, byte[] mediaData, int mediaOriginalLength)
 Sends a media to the remote host. Retuns true if the packet was successfully enqueued to the outgoing media packet queue. If the socket is not connected, has become faulted or the outgoing packet queue is already filled, returns false. More...
 
bool SendRoutingRequest (string fromGuid, string toGuid, bool enableRouting)
 Sends a routing request to the remote host. The socket enforces no rules on the guids that are specified on the request. More...
 

Public Attributes

MediaPacketReceived MediaPacketReceivedEvent
 
ControlPacketReceived ControlPacketReceivedEvent
 
SuspectedConnectionProblem SuspectedConnectionProblemEvent
 
ConnectionFailed ConnectionFailedEvent
 

Properties

int SocketTimeoutMilliseconds [get, set]
 
bool IsFaulted [get]
 True, if the socket has been enabled and the connection to remote host has failed. Such socket is no longer enabled. Otherwise false. More...
 
bool IsEnabled [get]
 True, if the socket is enabled and functional. Otherwise false. More...
 

Detailed Description

Client socket implementing a simple UDP-based media transfer protocol. Delivery of packets is not guaranteed. Sent packets are split to conform to the specified MTU. The underlaying IP checksum is relied upon for the integrity of the packets. Constant ping packets are employed to monitor the connection and to keep the UDP packets routed in both directions by the network channel.

<author>Veli-Mikko Puupponen</author> This socket is usable in both peer-to-peer and server connection scenarios.

The existance of a remote host is monitored with constant ping packets. If excessive number of consecutive ping replies is lost, the socket is deemed faulted and the ConnectionFailedEvent is fired.

Uses separate sequence number counters for control, ping and media transfer packets.

Constructor & Destructor Documentation

UdpMediaClientSocket ( string  serverIpAddress,
int  serverPort,
int  localPort,
string  clientGuid,
int  networkMtu,
int  timeOutMillis 
)

Initializes a new UdpMediaClientSocket to connect to the specified host. The provided GUID is used for identifying this client during the connection. The socket is not connected before a call to the Connect method. The socket will use the specified MTU on the network packets. The underlying UDP socket will use the specified port at the local system.

Parameters
serverIpAddressIp address of the server or peer in the standard string format
serverPortPort at the remote host
localPortPort at the local system
clientGuidGuid identifying this client
networkMtuMTU for the underlying network
timeOutMillisTime-out limit for send operations on the underlying UDP socket
UdpMediaClientSocket ( string  serverIpAddress,
int  serverPort,
int  localPort,
string  clientGuid,
int  networkMtu 
)

Initializes a new UdpMediaClientSocket to connect to the specified host. The provided GUID is used for identifying this client during the connection. The socket is not connected before a call to the Connect method. The socket will use the specified MTU on the network packets. The underlying UDP socket will use the specified port at the local system.

Parameters
serverIpAddressIp address of the server or peer in the standard string format
serverPortPort at the remote host
localPortPort at the local system
clientGuidGuid identifying this client
networkMtuMTU for the underlying network
UdpMediaClientSocket ( string  serverIpAddress,
int  serverPort,
string  clientGuid,
int  networkMtu 
)

Initializes a new UdpMediaClientSocket to connect to the specified host. The provided GUID is used for identifying this client during the connection. The socket is not connected before a call to the Connect method. The socket will use the specified MTU on the network packets.

Parameters
serverIpAddressIp address of the server or peer in the standard string format
serverPortPort at the remote host
clientGuidGuid identifying this client
networkMtuMTU for the underlying network
UdpMediaClientSocket ( string  serverIpAddress,
int  serverPort,
string  clientGuid 
)

Initializes a new UdpMediaClientSocket to connect to the specified host. The provided GUID is used for identifying this client during the connection. The socket is not connected before a call to the Connect method. The socket will use a default MTU of 1024 bytes on the network.

Parameters
serverIpAddressIp address of the server or peer in the standard string format
serverPortPort at the remote host
clientGuidGuid identifying this client
UdpMediaClientSocket ( int  pingLossLimit,
string  serverIpAddress,
int  serverPort,
string  clientGuid 
)

Initializes a new UdpMediaClientSocket to connect to the specified host. The provided GUID is used for identifying this client during the connection. The socket is not connected before a call to the Connect method. The socket will use a default MTU of 1024 bytes on the network.

Parameters
pingLossLimitThe meximum allowable number of lost consecutive ping packets
serverIpAddressIp address of the server or peer in the standard string format
serverPortPort at the remote host
clientGuidGuid identifying this client

Member Function Documentation

void Connect ( )

Connects a non-connected instance. This method needs to be called prior to any send operations for them to succeed.

void Disconnect ( )

Disconnets a connected instance.

bool SendMedia ( MediaInformation  mediaInfo,
byte[]  mediaData,
int  mediaOriginalLength 
)

Sends a media to the remote host. Retuns true if the packet was successfully enqueued to the outgoing media packet queue. If the socket is not connected, has become faulted or the outgoing packet queue is already filled, returns false.

Parameters
mediaInfoInformation describing the outgoing media
mediaDataMedia data bytes
mediaOriginalLengthLength of the original data in case of compressions that require this value for decompression at the remote end.
Returns
bool SendRoutingRequest ( string  fromGuid,
string  toGuid,
bool  enableRouting 
)

Sends a routing request to the remote host. The socket enforces no rules on the guids that are specified on the request.

Parameters
fromGuidThe guid of the source for the routing request
toGuidThe guid of the target for the routing request
enableRoutingWhether routing between the client sockets using the specified should be enabled or disabled.
Returns

Property Documentation

bool IsEnabled
get

True, if the socket is enabled and functional. Otherwise false.

bool IsFaulted
get

True, if the socket has been enabled and the connection to remote host has failed. Such socket is no longer enabled. Otherwise false.


The documentation for this class was generated from the following file: