[plt-scheme] TCP input ready

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Fri Aug 16 08:34:57 EDT 2002

> - I search how to know if datas are available on an input tcp port,
> automatically (like an exception), without using the "char-ready?"
> predicate?

I'm not sure what you need, but you might create a thread that uses
`object-wait-multiple' to block until data is ready:

  (thread
    (lambda ()
      (object-wait-multiple #f tcp-in-port)
      ... notify some other thread ...))

The notification part might use `break-thread' if you really want an
asychronous exception.

Matthew




Posted on the users mailing list.