Waiting on Sockets or File Descriptors

Peter Simons simons at cryp.to
Tue Feb 1 18:16:11 EST 2005


Hi,

I have the following problem: I use an external library
through the foreign function interface which gives me
_several_ sockets and expects me to call it again when any
of those sockets becomes readable or writable.

Since I know that the Haskell run-time system has all the
required functionality in place, I wonder whether there is
any way to register these sockets in the internal scheduler
and have it call an 'IO ()' function in case of such an
event?

What makes matters more complicated is that the _library_
owns these sockets -- not me. So I cannot really touch them
or lift them into a 'Handle'.

Any ideas?

Peter



More information about the Glasgow-haskell-users mailing list