Hi,
Paul Alfille:
> Part of the difficulty is that the link and other adapters can send variable
> length responses, or even extra characters when presence pulses arrive. For
> that reason, the read is wrapped in a select with a timeout.
This guarantees that the read() will complete immediately(*).
> Writes always seemed deterministic
_seemed_. Unless a select() on the write side returns with the
appropriate bit still set, you can't assume that a write() won't
block / return -EAGAIN.
> Should we still put a timeout on the writes? Especially if it's blocking?
>
If it's blocking, you can get an unlimited stall.
I'd recommend to keep nonblocking turned on, and to use a simple
select-with-timeout behind the write() call; just treat EAGAIN as a
"legal" zero-byte write. (I assume that you already handle short writes.)
That way, you don't need an additional superfluous syscall if the port
is ready to accept data, which should be the standard case.
--
Matthias Urlichs | {M:U} IT Design @ m-u-it.de | [EMAIL PROTECTED]
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Owfs-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/owfs-developers