Under load, I'm noticing our RTSP server occasionally hangs in this location:<br><br>static int blockUntilReadable(UsageEnvironment& env,<br> int socket, struct timeval* timeout) {<br> int result = -1;<br>
do {<br> fd_set rd_set;<br> FD_ZERO(&rd_set);<br> if (socket < 0) break;<br> FD_SET((unsigned) socket, &rd_set);<br> const unsigned numFds = socket+1;<br><br> result = select(numFds, &rd_set, NULL, NULL, timeout); <--HANG<br>
<br>I added some logging and found that the select() timeout is NULL, which is infinite. I would expect this to unblock when data arrived on the socket, but no amount of connection attempts seems to wake it up--it stays there, blocking the Live555 thread from servicing any new clients. Also, what code would be calling this with a NULL timeout?<br>
<br>The other thing I notice is our netstat output:<br><br># netstat -an<br>Active Internet connections (servers and established)<br>Proto Recv-Q Send-Q Local Address Foreign Address State<br>tcp 0 0 <a href="http://0.0.0.0:5222">0.0.0.0:5222</a> 0.0.0.0:* LISTEN<br>
tcp 0 0 <a href="http://0.0.0.0:5800">0.0.0.0:5800</a> 0.0.0.0:* LISTEN<br>tcp 0 0 <a href="http://0.0.0.0:5000">0.0.0.0:5000</a> 0.0.0.0:* LISTEN<br>
tcp 0 0 <a href="http://0.0.0.0:5802">0.0.0.0:5802</a> 0.0.0.0:* LISTEN<br>tcp 21 0 <a href="http://0.0.0.0:554">0.0.0.0:554</a> 0.0.0.0:* LISTEN<br>
<br>When it's in a failed state, I always see 21 on the Recv-Q, which is "The count of bytes not copied by the user program connected to this
socket.<a name="lbBD">" We're using Linux (2.6.18, so a bit old).<br><br>Does anyone know why this may be, or have any suggestions for fixing it? Thanks!<br></a>