[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Serial Design Issue: "Serial::isPending" Semantics
From: |
Conrad T. Pino |
Subject: |
Serial Design Issue: "Serial::isPending" Semantics |
Date: |
Fri, 9 Sep 2005 15:45:10 -0700 |
Hi David,
=======================================================================
The "Serial::isPending( pendingInput )" implementation looks clean.
A "true" return means data is available for reading on all platforms.
=======================================================================
The "Serial::isPending( pendingOutput )" implementation is problematic.
A "true" return on WIN32 platform means either:
data was written but the write is NOT complete: 0 != cs.cbOutQue
transmit buffer is empty
A "true" return on UNIX platform means either:
device file handle is ready for writing
The second WIN32 case and UNIX case are sufficiently consistent to be
useful to thread that needs to know when a write can happen.
The first WIN32 case is inconsistent with other two cases and isn't
useful to a thread that wants to keep data moving whenever possible.
I recommend removing this case altogether.
=======================================================================
The "Serial::isPending( pendingError )" implementation is inconsistent.
A "true" return on UNIX platform means an exceptional conditions or a
disconnect has occurred.
The WIN32 platform *never* returns true. Worse errors on WIN32 are
often cleared without being recorded which effectively ignores them.
Clearly WIN32 not supported well in this class family. I believe the
documentation should state the limitations better.
=======================================================================
Best regards,
Conrad Pino
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Serial Design Issue: "Serial::isPending" Semantics,
Conrad T. Pino <=