[racket] scheme_call_enable_break

From: Laurent (laurent.orseau at gmail.com)
Date: Mon Apr 22 06:36:40 EDT 2013

Yes, but given Matthew's code, it first waits (i.e., blocks) with `sync'
until a client tries to connect (but does not `accept' it yet).
Then it goes to atomic (i.e., somewhat non-interruptible) mode and before
accepting the client, it checks again that the client is still there.
For this last part, I was trying to use sync/timeout; A zero value for the
timer thus returns #f only if no event could sync, i.e. (I thought) if no
client is waiting.
(From the docs: "If timeout is a procedure, then it is called in tail
position if polling the evts discovers no ready events.")

But it seems that the event has already been processed and is not available
anymore or something.


On Mon, Apr 22, 2013 at 12:21 PM, Diogo F. S. Ramos <diogofsr at gmail.com>wrote:

> Laurent <laurent.orseau at gmail.com> writes:
> > (sync/timeout 0 (scheme_fd_to_semaphore s MZFD_CREATE_READ #t))
> >
> > Unfortunately this does not work :)
> > It always returns #f.
> I'm not familiar with `sync/timeout' or `scheme_fd_to_semaphore', but
> from `sync/timeout's documentation:
>   "A zero value for timeout is equivalent to (lambda () #f). In either
>   case, each evt is checked at least once before returning #f or calling
>   timeout."
> So, I guess it's not a surprise that your call always returns `#f'. It's
> not blocking/waiting, how one would want in this situation.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20130422/62875606/attachment.html>

Posted on the users mailing list.