Possible bug in RTPInterface::sendDataOverTCP

Sergey Lvov serg_lvov at yahoo.com
Thu Sep 18 05:55:12 PDT 2014


Hallo everybody!

I discovered strange disconnections when I used streaming over TCP.
I recompiled live555 library with -DDEBUG and -DDEBUG_SEND and saw some diagnostic:

sendRTPorRTCPPacketOverTCP: 1448 bytes over channel 0 (socket 7)
sendDataOverTCP: resending 795-byte send (blocking)
sendDataOverTCP: blocking send() failed (delivering -1 bytes out of 795); closing socket 7
SocketDescriptor(socket 7)::deregisterRTPInterface(channel 255)
sendRTPorRTCPPacketOverTCP: failed! (errno 11)
RTSPClientConnection[0x8e80978]::handleRequestBytes() read 4 new bytes:$
RTSPClientConnection[0x8e80978]::handleRequestBytes() read 52 new bytes:?
schedule(5.170436->1411036332.468457)
RTSPClientConnection[0x8e7baf0]::handleRequestBytes() read 212 new bytes:GET_PARAMETER rtsp://192.168.0.35:8554/archive?record=541697a20c8ac43f&sessionId=35/ RTSP/1.0
CSeq: 21349
User-Agent: LibVLC/2.2.0-pre4-20140908-0202 (LIVE555 Streaming Media v2014.07.25)
Session: CED66A9C

So, errno 11 - it's EAGAIN, and that's very strange for socket in blocking mode.

However, I found topic: stackoverflow.com/questions/735249/blocking-socket-returns-eagain
And I understood that is quite possible.

I tried to fix the problem by this way:

-      sendResult = send(socketNum, (char const*)(&data[numBytesSentSoFar]), numBytesRemainingToSend, 0/*flags*/);
+      
+      do {
+           sendResult = send(socketNum, (char const*)(&data[numBytesSentSoFar]), numBytesRemainingToSend, 0/*flags*/);
+      } while(sendResult == -1 && envir().getErrno() == EAGAIN);


And it works now!

Could you possibly investigate this problem?

Thank you for you work!

Best regards,
Sergey.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20140918/a1574704/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sendDataOverTCP.patch
Type: application/octet-stream
Size: 1074 bytes
Desc: not available
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20140918/a1574704/attachment.obj>


More information about the live-devel mailing list