<html><body>
<p><font size="2" face="sans-serif">You are right about the "removeSocketDescription"  my explication was not good, forget about this.  I should not have waste time trying to find an explanation because I don't have a clear view why this is happening.  However this is what I have found so far, if this can help anybody track this down.</font><br>
<br>
<font size="2" face="sans-serif">So it first start with a readSocket failure on socket X, this trigs a deletion if SocketDescriptor, this I am sure.</font><br>
<br>
<font size="2" face="sans-serif">Now I do see that just after that background handling is turned on again on the socket X, just when a new TCP client connects using socket Y and is asking for the stream.  Right after that boom... bad file descriptor error.</font><br>
<font size="2" face="sans-serif">This new background handling comes from a call in RTPInterface::startNetworkReading, this is what I found by logging all access to all TCP sockets in the code. </font><br>
<br>
<font size="2" face="sans-serif">It looks like something is not cleaned up properly when the readSocket failure occurs.  I will try to create a test that reproduces the problem easily because so far this is very hard to repro, it is a question of having the right timing.  Hope this help.</font><br>
<br>
<font size="2" face="sans-serif">Serge</font><br>
<font size="2" face="sans-serif">Miranda Technologies</font><br>
<br>
<br>
<img width="16" height="16" src="cid:1__=0ABBF11DDFFCBCBE8f9e8a93df@BeldenCDT.com" border="0" alt="Inactive hide details for Ross Finlayson ---2013-06-18 16:04:07---> The problem I found is in RTPInterface.cpp file >"><font size="2" color="#424282" face="sans-serif">Ross Finlayson ---2013-06-18 16:04:07---> The problem I found is in RTPInterface.cpp file ></font><br>
<br>
<font size="1" color="#5F5F5F" face="sans-serif">From:      </font><font size="1" face="sans-serif">Ross Finlayson <finlayson@live555.com></font><br>
<font size="1" color="#5F5F5F" face="sans-serif">To:        </font><font size="1" face="sans-serif">LIVE555 Streaming Media - development & use <live-devel@ns.live555.com>, </font><br>
<font size="1" color="#5F5F5F" face="sans-serif">Date:      </font><font size="1" face="sans-serif">2013-06-18 16:04</font><br>
<font size="1" color="#5F5F5F" face="sans-serif">Subject:   </font><font size="1" face="sans-serif">Re: [Live-devel] windows winsock error 10038</font><br>
<font size="1" color="#5F5F5F" face="sans-serif">Sent by:   </font><font size="1" face="sans-serif">live-devel-bounces@ns.live555.com</font><br>
<hr width="100%" size="2" align="left" noshade style="color:#8091A5; "><br>
<br>

<ul style="padding-left: 36pt"><font size="2" face="sans-serif">The problem I found is in RTPInterface.cpp file</font><font size="3" face="serif"><br>
</font><font size="2" face="sans-serif"><br>
-> SocketDescriptor::tcpReadHandler1 line 422<br>
If readSocket fails (-1) it triggers a deletion of the SocketDescriptor object</font></ul>
<br>
<font size="3" face="serif">Correct.</font>
<ul style="padding-left: 36pt"><br>
<font size="2" face="sans-serif"><br>
However this is leaving a dangling pointer in the HashTable in RTPInterface (lookupSocketDescriptor)</font></ul>
<br>
<font size="3" face="serif">Incorrect - because the "SocketDescriptor" destructor calls "removeSocketDescription()", which will remove the "SocketDescriptor" object from the hash table.</font><br>
<br>
<font size="3" face="serif">(Note that the "SocketDescriptor" destructor also calls "turnOffBackgroundReadHandling()" on the socket, so that this socket will no longer get used in the event loop's "select()".)</font><br>
<br>
<br>
<font size="3" face="serif">As I noted earlier, the "bad file descriptor" error (or other socket error) in "select()" is caused by a socket getting closed somewhere without "turnOffBackgroundReadHandling()" also being called for the socket.  It's conceivable that there is a bug in the LIVE555 code somewhere that is causing this to happen - in which case I invite people to try to track it down.  However, what you described above is not it.</font><br>
<font size="3" face="serif"><br>
</font><br>
<font size="3" face="serif">Ross Finlayson<br>
Live Networks, Inc.</font><font size="3" color="#0000FF" face="serif"><u><br>
</u></font><a href="http://www.live555.com/"><font size="3" color="#0000FF" face="serif"><u>http://www.live555.com/</u></font></a><font size="3" face="serif"> </font><br>
<tt><font size="2">_______________________________________________<br>
live-devel mailing list<br>
live-devel@lists.live555.com<br>
</font></tt><tt><font size="2"><a href="http://lists.live555.com/mailman/listinfo/live-devel">http://lists.live555.com/mailman/listinfo/live-devel</a></font></tt><tt><font size="2"><br>
</font></tt><br>
<p>DISCLAIMER:

Privileged and/or Confidential information may be contained in this
message. If you are not the addressee of this message, you may not
copy, use or deliver this message to anyone. In such event, you
should destroy the message and kindly notify the sender by reply
e-mail. It is understood that opinions or conclusions that do not
relate to the official business of the company are neither given
nor endorsed by the company.

Thank You.
</p>
</body></html>