<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><blockquote type="cite">I am troubleshooting an issue similar to Dirk Dugger when receiving RTP over TCP via the RTSPClient class.  If the server closes the connection mid stream, the client gets no notification.</blockquote><div><br></div>As I also said in response to Dirk's question: In general it's a bad idea to complicate your application by trying to optimize the handling of an unusual situation.</div><div><br></div><div>This answer - to a similar question last month - outlines what I think is the best way to handle this situation (and other, more general situations):</div><div><span class="Apple-tab-span" style="white-space:pre">     <a href="http://lists.live555.com/pipermail/live-devel/2012-June/015348.html">http://lists.live555.com/pipermail/live-devel/2012-June/015348.html</a></span></div><div><br></div><div>However, concerning the specific problem that you referred to:</div><div><br><blockquote type="cite"><div>I have traced the problem to the readSocket() function in GroupsockHelper.cpp where recvfrom() is used to get data from the socket.  On posix systems, recvfrom() should return the number of bytes read, or a negative number on error, or **zero if the connection is TCP and the peer has closed its half side of the connection**.</div></blockquote><div><br></div>I *might* be able to modify the "readSocket()" function to better handle this case, but I don't want to risk inadvertently messing up higher-level code that uses this function by mishandling cases when "recvfrom()" might return zero in a *non*-error situation.</div><div><br></div><div>In the situation that you are concerned about - recvfrom() returning "zero if the connection is TCP and the peer has closed its half side of the connection" - what is the value of "errno" in this case?  (If it's something non-zero, then I should be able to update "readSocket()" to add a test for this.)</div><br><br><div apple-content-edited="true">
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; ">Ross Finlayson<br>Live Networks, Inc.<br><a href="http://www.live555.com/">http://www.live555.com/</a></span></span>
</div>
<br></body></html>