[plt-scheme] scheme equivelent(?) to select(2)?

From: Mike (mikee at mikee.ath.cx)
Date: Sat Jun 10 19:37:10 EDT 2006

On Sun, 11 Jun 2006, Jepri might have said:

> Since mzscheme appears to support threads for every platform it runs on, 
> I tend to write network code that makes a thread for every port.  Then 
> I  use  read in each thread and let the calls block.   I'm not sure of 
> the best way to do it in one thread.
> Mike wrote:
> >I'm working on the tcp portion of my server monitor.  I C at
> >this point I would use select(2) to detect if any connections to
> >servers had messages to read. In the manual under the TCP section
> >I do see ways to 'peek' for bytes, but nothing that seems to be a
> >select() call. I have my connections stored in a hash and am using
> >(hash-table-for-each) to loop through the current connections. I
> >guess what I really want is more of something like (read? p) that
> >returns #t if there are bytes available for reading.
> >
> >Mike

Thanks to everyone that responded!


Posted on the users mailing list.