<HTML><HEAD></HEAD>
<BODY dir=ltr>
<DIV dir=ltr>
<DIV style="FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: 12pt">
<DIV>Hi Ross;</DIV>
<DIV> </DIV>
<DIV>We use the event loop ‘watch variable’ mechanism to stop the event loop and
terminate our application (which is based on the testRTSPClient sample).
This works about 99.9% of the time. However our systems run 24/7 and
occasionally we are finding that the event loop does not terminate. After
some painful investigation we figured out why. The problem is in
RTPInterface.cpp, member function sendDataOverTCP(). The event loop is
hung in the socket send function – because the socket is in blocking mode.</DIV>
<DIV> </DIV>
<DIV>We have modified the live555 source as follows. Instead of making the
socket blocking we have set a send timeout with:</DIV>
<DIV> </DIV>
<DIV>int milliseconds = 1000;</DIV>
<DIV>setsockopt(socket, SOL_SOCKET, SO_SNDTIMEO, (char *)&milliseconds,
sizeof(int));</DIV>
<DIV> </DIV>
<DIV>This prevents the hanging and allows the event loop to exit.</DIV>
<DIV> </DIV>
<DIV>Another option would be to close the socket handle from a different thread
which would cause the socket send function to return. (This is how we
break out of a blocking socket call in other environments). However there
does not seem to be a way to get the socket handle since these variables are
private, as is RTSPClient::resetTCPSockets.</DIV>
<DIV> </DIV>
<DIV>We would prefer not to modify live555 source, so if you have any
suggestions we would greatly appreciate it.</DIV>
<DIV> </DIV>
<DIV>Thank you,</DIV>
<DIV>Gord.</DIV></DIV></DIV></BODY></HTML>