Halyri - Udp-client
0.9.1
|
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... | |
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.
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.
serverIpAddress | Ip address of the server or peer in the standard string format |
serverPort | Port at the remote host |
localPort | Port at the local system |
clientGuid | Guid identifying this client |
networkMtu | MTU for the underlying network |
timeOutMillis | Time-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.
serverIpAddress | Ip address of the server or peer in the standard string format |
serverPort | Port at the remote host |
localPort | Port at the local system |
clientGuid | Guid identifying this client |
networkMtu | MTU 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.
serverIpAddress | Ip address of the server or peer in the standard string format |
serverPort | Port at the remote host |
clientGuid | Guid identifying this client |
networkMtu | MTU 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.
serverIpAddress | Ip address of the server or peer in the standard string format |
serverPort | Port at the remote host |
clientGuid | Guid 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.
pingLossLimit | The meximum allowable number of lost consecutive ping packets |
serverIpAddress | Ip address of the server or peer in the standard string format |
serverPort | Port at the remote host |
clientGuid | Guid identifying this client |
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.
mediaInfo | Information describing the outgoing media |
mediaData | Media data bytes |
mediaOriginalLength | Length of the original data in case of compressions that require this value for decompression at the remote end. |
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.
fromGuid | The guid of the source for the routing request |
toGuid | The guid of the target for the routing request |
enableRouting | Whether routing between the client sockets using the specified should be enabled or disabled. |
|
get |
True, if the socket is enabled and functional. Otherwise false.
|
get |
True, if the socket has been enabled and the connection to remote host has failed. Such socket is no longer enabled. Otherwise false.