tguclu
tguclu

Reputation: 719

UDP transmit performance

I have an application that transmits some data in a loop. Underlying protocol is UDP on WinSock. If I don't add sleep(1ms) after each transmit operation most of the data is not sent (or wireshark can not capture it) Have you experienced such a behavour that UDP does not handle repetitive sending in a loop ?

Regards

Tugrul

Upvotes: 0

Views: 416

Answers (1)

Tayyab
Tayyab

Reputation: 10651

First thing you should check the return values when you send data to check if data is successfully sent or not. Second thing, This can happen internal buffer of UDP cannot accommodate more data because previous data is yet not transmitted. So the simplest solution is that each time before send the data you should check if your UDP socket is writable or not. You can do it by calling "select" or "poll" on that UDP socket.

Upvotes: 1

Related Questions