Hi Bill,

Thanks for taking the time to comment. Sorry about the confusion surrounding my post. Both Perl and Tk were closed before restarting.

There are actually two issues here. One regards closing the port with characters remaining. The sensible approach, I think, would be for the system just to empty the buffer on a close, rather to wait for any handshaking to unblock (which may never happen) or to leave the port in a closed-but-nonempty state. If the programmer is concerned about those last characters getting to the connected device (I'm not), he can check the transmit buffer and wait for it to empty before issuing the close command. But when a close is issued, it should mean just that -- graceless though it might be -- regardless of state. And the system should be relied upon to mop up any messes left behind.

The second issue regards opening a port that's in this weird state of limbo. Non-Perl apps don't seem to have a problem recognizing that the port can be forced back open and proceed accordingly without complaint. It would be nice if Perl apps could do the same.


In reply to Re^3: Win32::SerialPort Error: Overlapped-I/O operation is in progress by Dr. Mu
in thread Win32::SerialPort Error: Overlapped-I/O operation is in progress by Dr. Mu

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.