What moritz has said is correct.
In my experience the best way to deal with serial communications is to formulate a protocol that both sides of the line will follow. Usually this involves having a fixed message size or ending the message with a terminating character (such as a CR). Also, it is common to have a checksum of the bytes embedded in the message. As long as both parties agree and there isn't too much noise on the line, it should work.
As for the Win32::SerialPort module, it looks to be very outdated, the interface isn't very good, and the examples are somewhat complicated. I also didn't see anything having to do with flushing.
In reply to Re: win32::serial port
by lostjimmy
in thread win32::serial port
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |