[Live-devel] Forcing TCP packets to send immediately from server

Paul Westlund paul.westlund at currentcorp.com
Tue Jun 4 17:39:46 PDT 2024


Hello,

I am running the testOnDemandRTSPServer with a very low bandwidth H264 file (~60 Kbps) that is encoded for 30 fps. On a separate computer I then connect to the stream using the testRTSPClient with REQUEST_STREAMING_OVER_TCP=True. The frames are all received correctly and the presentation times are correct, but the arrival of the frames is inconsistent. After looking into it further it appears that the inconsistency in arrival is due to the TCP packets not being immediately sent by the server. Instead since they are much smaller than the MTU of 1500 bytes, they are grouped together and sent about every 45ms (instead of the expected 33ms). I added an additional step in setupStreamSocket that sets the TCP_NODELAY flag and this seems to resolve the issue (they now are sent every 33ms).

The issue does not seem to be present when running both server and client on the same machine (I'm assuming this is due to the way TCP is handled on a loopback interface). However, I was able to recreate the issue when running the server on WSL and the client on Windows from the same machine.

Is there some way that setting TCP_NODELAY could be incorporated into LIVE555, maybe as a build option similar to the REUSE_FOR_TCP macro? Or can the socket properties be modified outside of the LIVE555 library?

Thanks,
Paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20240605/362472f6/attachment.htm>


More information about the live-devel mailing list