AsynchronousByteCharChannel and Timeouts
cowwoc
cowwoc at bbs.darktech.org
Thu Jul 15 05:17:03 PDT 2010
Hi Alan,
Replies below.
On 14/07/2010 11:09 AM, Alan Bateman wrote:
> The intended behavior is that a read operation completes when some
> bytes (up to r) are read. The result of the operation is the number of
> bytes read. It just wouldn't be useful otherwise as there are many
> protocols where you don't know the number of bytes in advance.
Please make sure that this is spelled out explicitly in the
specification. I did not think of this and I suspect that others might
not as well. Either way, I prefer that the specification spell this out
explicitly so users don't have to make assumptions.
>> How does this (substantially) increase the burden on the implementer? I
>> assume you're not talking about the extra burden of implementing
>> read-forever on top of read-with-timeout because this just requires
>> you to
>> wrap your existing code with a single while() loop.
> The extra burden is that it would require every implementation to
> include support for timeouts.
How can users develop robust software on top of sockets, serial
ports, and other potentially-blocking streams without timeout support?
Don't all operating systems provide timeout support for them anyway?
Thank you,
Gili
More information about the nio-discuss
mailing list