|
From: | Thomas Chust |
Subject: | Re: [Chicken-users] non-blocking (read) |
Date: | Tue, 19 Jul 2005 13:49:25 +0200 |
User-agent: | Mozilla Thunderbird 1.0.2 (Macintosh/20050317) |
Hello,why don't you just use (file-select ...) on the STDIN descriptor (descriptor number 0) directly?
You could also cook up some code using fcntl to switch descriptor 0 into non-blocking mode, checking for EWOULDBLOCK returns from read calls and ensuring proper multithreading with the builtin ##sys#thread-block-for-i/o primitive. For an example how that can be done and neatly wrapped into a custom input port, I suggest you read the sourcecode of CHICKEN's tcp unit.
cu, Thomas Chust
[Prev in Thread] | Current Thread | [Next in Thread] |