Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

COMMTIMEOUTS: optimal values for WriteTotalTimeoutConstant

276 views
Skip to first unread message

Hetal

unread,
Feb 25, 2003, 5:13:27 PM2/25/03
to
Hey All,

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.

Tonu Aas

unread,
Feb 28, 2003, 5:14:22 AM2/28/03
to
> 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.

This works fine for me:

commtimeouts.ReadTotalTimeoutMultiplier = 0;
commtimeouts.ReadTotalTimeoutConstant = 0;
commtimeouts.WriteTotalTimeoutMultiplier = 0;
commtimeouts.WriteTotalTimeoutConstant = 100; // for stupid
softmodems

Tõnu.


0 new messages