I have synaser ticking over nicely, and decided to clean up some exception cases.
One instance I wanted to cover, is a connected device (FTDI), where everything works _but_ the remote end does not empty.
ie a system state with a full buffer on the end of the cable, and some bytes still in the PC queue.
This will be rare, but more graceful handling would be good.
I have activated Timeout ok, and hooked into the exception, but when I try to close the port, in TBlockSerial.CloseSocket, it seems to stall on the line : FileClose(integer(FHandle));
This means I can Step/break fine up to here, but FileClose never returns - until I physically unplug the USB cable.
Then it continues...
I suspect because SOME data has gone, it thinks it is still active, so refuses to close ?
I cannot find any other Close/release paths, but I found a couple of examples on here, which suggest this should work, but they are not for my exact test case.
CloseSocket seems to work fine, provided there is no over-run
(ie no bytes still in queue at PC end )
Has anyone got examples, or comments on handling this case ?
Or anything else I need to do, before Close ?
( I see CloseSocket includes a purge call.)