in reply to Re: Win32::SerialPort Error: Overlapped-I/O operation is in progress
in thread Win32::SerialPort Error: Overlapped-I/O operation is in progress
and explicit checks of write_done(0) around the Tk callbacks to prevent beginning new writes while an old one is in progress. That demo also ran with no handshaking.# "write" first to init "write_done"
In the code given, it is not clear which internal operations are blocking/non-blocking. But he does comment on handshaking and buffer management (and uses the is_xx_limit parameters).
I have to speculate a bit about the state information. It is not stored explicitly, although when he closes the app with characters remaining in the write buffer - but blocked by the handshaking - they are actually in the serial driver's buffer (during an "overlapped", i.e. non-blocking TO PERL background write). It is not clear if both Perl and Tk are closed before restarting. He may be holding an OS handle open. But I don't know for sure.
I do think flushing the buffer on close (e.g. by setting handshake to 'none' or doing a blocking write) will fix the problem.
-bill
Edit by tye: Preserve formatting
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Win32::SerialPort Error: Overlapped-I/O operation is in progress
by Dr. Mu (Hermit) on Mar 30, 2005 at 06:59 UTC |