<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div><blockquote type="cite"> // For some unknown reason, select() in Windoze sometimes fails with WSAEINVAL if<br> // it was called with no entries set in "readSet". If this happens, ignore it:<br> if (err == WSAEINVAL && readSet.fd_count == 0) {<br> err = EINTR;<br> // To stop this from happening again, create a dummy socket:<br> int dummySocketNum = socket(AF_INET, SOCK_DGRAM, 0);<br> FD_SET((unsigned)dummySocketNum, &fReadSet);<br> }<br> if (err != EINTR) {<br>#else<br><br>But the dummySocket is never closed.<br></blockquote><div><br></div>Yeah, OK, in some future release I'll close "dummySocket" in the "BasicTaskScheduler" destructor.</div><div><br></div><div>Alternatively, because this code is Windows-specific (to work around a bug in Windows), you could use another OS.</div><div><br></div><div><br><blockquote type="cite">As during the lifetime of the process we can create/destroy many TaskScheduler, this small leak becomes important.<br></blockquote><div><br></div>This (using a single, permanent process in which you repeatedly create objects, then destroy them all) is poor system design. (Maybe there's something in your OS that requires you to design your system this way? Even if so, that doesn't escape the fact that this is poor system design. Helping people who design their systems this way is not a high priority for me.)</div><div><br></div><div><br><blockquote type="cite">Do you think it could be safe to add a close(dummySocketNum) ?<br></blockquote><div><br></div>Definitely not (unless this is done only in the "BasicTaskScheduler"s destructor). Having a closed socket in the select() 'read set' will lead to an 'invalid file descriptor' error.</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; "><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; ">Ross Finlayson<br>Live Networks, Inc.<br><a href="http://www.live555.com/">http://www.live555.com/</a></span></span>
</div>
<br></body></html>