[Live-devel] RTSP Server Packet Loss

Martin Sherburn Martin.Sherburn at datapath.co.uk
Fri Nov 27 07:02:33 PST 2015


Dear Live555 Developers,

I have discovered a bug whereby UDP packets are getting lost using live555MediaServer. The issue is that the socket used for sending the packets is set to non-blocking mode. Occasionally when the application sends a lot of data in a short amount of time the sendto function within writeSocket in GroupsockHelper.cpp  returns -1, and WSAGetLastError reports WSAEWOULDBLOCK. Unfortunately the packet is then discarded and no attempts to try and send it again later are made.

I was able to fix this by putting the socket into blocking mode, thus if the buffers are full it will wait until there is space before returning which should be a very short amount of time anyway. I have tested the fix under both windows and linux and in both cases it reduced my packet loss to 0 measured on the client side. I have attached a patch, please let me know if there could be any reason it's not a good idea to make the sending socket blocking. The alternative would be to keep the socket in non-blocking mode but make sure that the packet is re-queued for sending upon receiving the WSAEWOULDBLOCK error, that seems like a more involved change though.

Regards,

Martin Sherburn.

______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20151127/545cdeb8/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-for-packets-getting-lost-when-OS-send-buffer-que.patch
Type: application/octet-stream
Size: 749 bytes
Desc: 0001-Fix-for-packets-getting-lost-when-OS-send-buffer-que.patch
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20151127/545cdeb8/attachment.obj>


More information about the live-devel mailing list