Wolfgang Walter wine@stwm.de wrote:
I have no intention to discuss that all again. Please think about the problem. Hint: writing twice as many bytes with 150 baud needs more time, significantly more time then TIMEOUT.
Not really. Francois sent an investigation with pretty exhaustive explanation of the behvaiour of COM-port UARTs regarding timings and baud rates.
Have you read it? It says that with a standard UART windows may signals after 872ms that the tx queue is empty (though there are still 4 bytes to send) when you write 17 bytes. For 34 bytes he gets 1802ms > TIMEOUT.
Where do you see 34 bytes to be written in that test?
And I really don't think that we can expect exactly that same behaviour when using the linux serial driver, anyway.
At the time I was reworking the EV_TXEMPTY to use overlapped IO the reasoning for using 900 ms as the designed time was simple: that was enough to make the test pass under Windows with real hardware. How the patch we are discussing makes the test pass for me under Linux with a USB-serial adapter, which confirms that there is no reasons that it can't work under Linux as well.
I understand that there are cases of (really old) hardware where this limit may not be enough, and Francois has already sent a patch which increases timeout. The Francois' patch hasn't been accepted, but that's a different matter.