<html><body><div style="color:#000; background-color:#fff; font-family:verdana, helvetica, sans-serif;font-size:10pt"><div style="" class="">Hallo everybody!</div><div style="" class=""><br style="" class=""></div><div class="" style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: verdana,helvetica,sans-serif; background-color: transparent; font-style: normal;">I discovered strange disconnections when I used streaming over TCP.</div><div class="" style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: verdana,helvetica,sans-serif; background-color: transparent; font-style: normal;">I recompiled live555 library with -DDEBUG and -DDEBUG_SEND and saw some diagnostic:</div><div class="" style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: verdana,helvetica,sans-serif; background-color: transparent; font-style: normal;"><br style="" class=""></div><div class="" style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family:
 verdana,helvetica,sans-serif; background-color: transparent; font-style: normal;">sendRTPorRTCPPacketOverTCP: 1448 bytes over channel 0 (socket 7)<br style="" class="">sendDataOverTCP: resending 795-byte send (blocking)<br style="" class="">sendDataOverTCP: blocking send() failed (delivering -1 bytes out of 795); closing socket 7<br style="" class="">SocketDescriptor(socket 7)::deregisterRTPInterface(channel 255)<br style="" class="">sendRTPorRTCPPacketOverTCP: failed! (errno 11)<br style="" class="">RTSPClientConnection[0x8e80978]::handleRequestBytes() read 4 new bytes:$<br style="" class="">RTSPClientConnection[0x8e80978]::handleRequestBytes() read 52 new bytes:?<br style="" class="">schedule(5.170436->1411036332.468457)<br style="" class="">RTSPClientConnection[0x8e7baf0]::handleRequestBytes() read 212 new bytes:GET_PARAMETER rtsp://192.168.0.35:8554/archive?record=541697a20c8ac43f&sessionId=35/ RTSP/1.0<br style="" class="">CSeq: 21349<br
 style="" class="">User-Agent: LibVLC/2.2.0-pre4-20140908-0202 (LIVE555 Streaming Media v2014.07.25)<br style="" class="">Session: CED66A9C</div><div class="" style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: verdana,helvetica,sans-serif; background-color: transparent; font-style: normal;"><br style="" class=""></div><div class="" style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: verdana,helvetica,sans-serif; background-color: transparent; font-style: normal;">So, errno 11 - it's EAGAIN, and that's very strange for socket in blocking mode.</div><div class="" style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: verdana,helvetica,sans-serif; background-color: transparent; font-style: normal;"><br style="" class=""></div><div class="" style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: verdana,helvetica,sans-serif; background-color: transparent; font-style: normal;">However, I found topic:
 stackoverflow.com/questions/735249/blocking-socket-returns-eagain</div><div class="" style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: verdana,helvetica,sans-serif; background-color: transparent; font-style: normal;">And I understood that is quite possible.</div><div class="" style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: verdana,helvetica,sans-serif; background-color: transparent; font-style: normal;"><br style="" class=""></div><div class="" style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: verdana,helvetica,sans-serif; background-color: transparent; font-style: normal;">I tried to fix the problem by this way:</div><div class="" style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: verdana,helvetica,sans-serif; background-color: transparent; font-style: normal;"><br style="" class=""></div><div class="" style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: verdana,helvetica,sans-serif;
 background-color: transparent; font-style: normal;">-      sendResult = send(socketNum, (char const*)(&data[numBytesSentSoFar]), numBytesRemainingToSend, 0/*flags*/);<br style="" class="">+      <br style="" class="">+      do {<br style="" class="">+           sendResult = send(socketNum, (char const*)(&data[numBytesSentSoFar]), numBytesRemainingToSend, 0/*flags*/);<br style="" class="">+      } while(sendResult == -1 && envir().getErrno() == EAGAIN);<br style="" class=""></div><div class="" style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: verdana,helvetica,sans-serif; background-color: transparent; font-style: normal;"><br></div><div class="" style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: verdana,helvetica,sans-serif; background-color: transparent; font-style:
 normal;">And it works now!</div><div class="" style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: verdana,helvetica,sans-serif; background-color: transparent; font-style: normal;"><br></div><div class="" style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: verdana,helvetica,sans-serif; background-color: transparent; font-style: normal;">Could you possibly investigate this problem?</div><div class="" style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: verdana,helvetica,sans-serif; background-color: transparent; font-style: normal;"><br></div><div class="" style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: verdana,helvetica,sans-serif; background-color: transparent; font-style: normal;">Thank you for you work!</div><div class="" style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: verdana,helvetica,sans-serif; background-color: transparent; font-style: normal;"><br></div><div class="" style="color:
 rgb(0, 0, 0); font-size: 13.3333px; font-family: verdana,helvetica,sans-serif; background-color: transparent; font-style: normal;">Best regards,</div><div class="" style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: verdana,helvetica,sans-serif; background-color: transparent; font-style: normal;">Sergey.<br style="" class=""></div></div></body></html>