<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi,<div>I have an issue on Mac OSX where the RTSPClient was throwing SIG_PIPE whenever the TCP connection from the server was terminated (server timeout or crash).</div><div>Trying to USE_SIGNALS as below did not work and we were still crashing when the connection was dropping:</div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><span style="color: #88185d">#ifdef</span> USE_SIGNALS</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(68, 133, 103); "><span style="color: #000000"> </span>// Ignore the SIGPIPE signal, so that clients on the same host that are killed</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(68, 133, 103); "><span style="color: #000000"> </span>// don't also kill us:</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> <span style="color: #6d3688">signal</span>(SIGPIPE, SIG_IGN);</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(136, 24, 93); ">#endif</div></div><div><br></div><div>The only way we found to fix ti was to set SO_NOSIGPIPE on the socket itself when created.</div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(68, 133, 103); "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> <span style="color: #88185d">if</span> (newSocket > 0) {</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> <span style="color: #88185d">int</span> set_option = 1;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> <span style="color: #88185d">if</span> (0 == <span style="color: #6d3688">setsockopt</span>(newSocket, SOL_SOCKET, SO_NOSIGPIPE, &set_option, <span style="color: #88185d">sizeof</span>(set_option))) {</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> } <span style="color: #88185d">else</span> {</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(49, 46, 255); "><span style="color: #000000"> <span class="Apple-tab-span" style="white-space:pre"> </span>socketErr(env,</span>"failed to set socket signal option"<span style="color: #000000">);</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> }</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> }</div></div><div><br></div><div>I have attached the source code with the change in <span class="Apple-style-span" style="color: rgb(49, 46, 255); font-family: Monaco; font-size: 11px; ">GroupsockHelper.cpp</span> . </div><div>Will it be possible to include that change in an upcoming release?</div><div><br></div><div>Let me know,<br><div apple-content-edited="true">
<div><br></div><div>Philippe</div>
</div>
</div></body></html>