Socket

Koen Claessen koen@cs.chalmers.se
Thu, 9 Aug 2001 16:43:50 +0200 (MET DST)


Hi,

I am implementing a modest webserver using GHC (as an
example program). I am using the Socket library.

In the Socket library, the following function is provided:

  accept :: Socket -> IO (Handle, HostName, PortNumber)

Unfortunately, this is a blocking function, which means that
the whole program blocks when it is waiting for a
connection.

This is not nice, since I would like to do something else in
the meantime (such as serving other clients).

I do not want to use the "concurrent" package (for a good
reason).

Ideally, I would like to integrate this with the function
"hSelect" from the Select module.

Has anybody had this problem before, and, if so, what could
be a solution?

Thanks,
/Koen.

--
Koen Claessen         http://www.cs.chalmers.se/~koen
phone:+46-31-772 5424      mailto:koen@cs.chalmers.se
-----------------------------------------------------
Chalmers University of Technology, Gothenburg, Sweden