Morgan
Morgan

Reputation: 486

QUdpSocket datagram

Is it possible, if I make 2 write consecutively on an udp socket (QUdpSocket in my case) from a client to a server, that I receive only one datagram with both data I wrote from my client ? Or am I sure that I will always get 2 separate datagrams ?

Upvotes: 0

Views: 260

Answers (1)

Kirill Chernikov
Kirill Chernikov

Reputation: 1420

You can be sure that you will not receive both data as one datagram. Also, you must keep in mind that UDP protocol don't guarantee delivery of all sending datagrams (it is not TCP protocol). Datagrams may be lost. That's why, you cann't be sure that you will receive always 2 separate datagrams (for your example). For more information, you can look UDP documentation: https://www.ietf.org/rfc/rfc768.txt

Upvotes: 3

Related Questions