[REBOL] Re: LDC goes Rugby!
From: holger:rebol at: 23-May-2001 6:30
On Wed, May 23, 2001 at 01:21:00PM +0200, Maarten Koopmans wrote:
> No-wait doesn't wait if there is no data.
>
> Async doesn't wait if there is data but less than you ask.
>
> Say there are 5 bytes of data on our port test,
>
> Then read-io test buffer 8
>
> would block on a sync port, 'no-wait or not. Async would read the 5 bytes,
> throw an error that it would be blocking (that you catch) and you continue
> later on.
No, not quite.
In your scenario, without 'async-modes read-io would still only return the
5 bytes, but then the next read-io, on an empty port, would block. This is
consistent with the way recv() in C works on blocking sockets.
With 'async-modes read-io returns the 5 bytes normally, without error, but
then the next call to read-io on an empty port throws an error instead of
blocking.
--
Holger Kruse
[holger--rebol--com]