Hi,<div><br></div><div>I'm wondering if there is a good way to figure out how much data is available on a socket. Right now I have a situation where my program accepts messages over a TCP socket. To check to see if a single message is available, I can just call wait-for-input with :timeout 0. But in order to check for multiple messages on a single socket, I need multiple calls to wait-for-input. So something like</div>
<div><br></div><div><div>(iter (for ready next (wait-for-input socket :timeout 0))</div><div>      (while (read-message socket)))</div></div><div><br></div><div>I'm avoiding multithreading to preserve compatibility with Lisps that don't support (or have unstable support for) threads.</div>
<div><br></div><div>The above works on most implementations, but breaks on SBCL/Windows, where subsequent calls to wait-for-input appear to block, despite the :timeout 0 parameter.</div><div><br></div><div>There may very well be a bug in the SBCL/Windows implementation in usocket to chase down here. Alternatively, is there a better way to do the above (assuming that multithread is unavailable in the implementation I want to run this on)?</div>
<div><br></div><div>Thanks.</div><div><br>-- <br>Elliott Slaughter<br><br>"Don't worry about what anybody else is going to do. The best way to predict the future is to invent it." - Alan Kay<br>
</div>