In my app, i had the CommTimeouts set to :
CommPortSetTimeouts(-1,0,0,4,4000) and it was working fine
communicatin to a device without eny error for long periods of times.
However, on failed writes, the timeout was pretty high which had to be
changed.
I changed the timeout values to: CommPortSetTimeouts(-1,0,0,5,500).
My communication works and is a little faster, but without flow
control, not reliable. I start seeing errors after a the app ahas been
looping data
for a while, where as before, this was not the case.
The app writes a max of about 1000 - 1500 bytes in one write? Are the
timeouts 5, 500 too small? If I increase this values, and pull out the
cable whle communication is going on, the app takes several seconds to
recover, whereas its less with the reduced timeout value.
Any ideas on what the ideal value for write timeouts should be? Also,
should this be baud rate dependent?
thanks
Hetal.
This works fine for me:
commtimeouts.ReadTotalTimeoutMultiplier = 0;
commtimeouts.ReadTotalTimeoutConstant = 0;
commtimeouts.WriteTotalTimeoutMultiplier = 0;
commtimeouts.WriteTotalTimeoutConstant = 100; // for stupid
softmodems
Tõnu.