|
From: | Julian Morrison |
Subject: | Re: [Chicken-users] Is there a way to get tcp-accept to time-out? |
Date: | Fri, 25 Feb 2005 14:58:30 +0000 |
User-agent: | Debian Thunderbird 1.0 (X11/20050116) |
Ed Watkeys wrote:
An alternative is to write a simple C procedure that can grab the fd from the socket, so it can be passed to file-select.
Looks like (file-select) is already a wrapper, but it appears to be a low-level one, ie: all the disadvantages of using C directly. And (port->fileno) will grab FDs.
I'd rather not have to deal with select's blocking and its interaction with Chicken's threads at the C level.
The whole point of using select is to avoid threading. Still, IIRC chicken's threads are cooperative, so just call (file-select) with very small timeouts, and yield the thread. You can count the small timeouts to do a large timeout, or use (current-milliseconds).
[Prev in Thread] | Current Thread | [Next in Thread] |