 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Ramy Guest
|
Posted: Thu Jul 20, 2006 9:49 pm Post subject: Strange 'WriteFile' Freezing problem |
|
|
Please Help, I'm having a very strange problem, sometimes my
application is "Freezing" in the following command -
WriteFile( hndl, TxBuff, MessageLen, &written, NULL );
(sending data through RS-232 port)
sometimes it's happening after 15 seconds, and sometimes after 2
minutes.... I checked the command parameters and they all looks
OK, I compared the command parameters (hndl, TxBuff...) when the
command works OK, and when it's freezing, and they looks exactly
the same..... what can be the problem ??
Thanks!
Ramy. |
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Fri Jul 21, 2006 12:12 am Post subject: Re: Strange 'WriteFile' Freezing problem |
|
|
"Ramy" <Ramy (AT) NoMail (DOT) com> wrote in message
news:44bfb418$1 (AT) newsgroups (DOT) borland.com...
| Quote: | Please Help, I'm having a very strange problem, sometimes
my application is "Freezing" in the following command -
WriteFile( hndl, TxBuff, MessageLen, &written, NULL );
(sending data through RS-232 port)
|
How much data are you actually sending? What kind of device is on the other
end of the port? What kind of timeouts are you using? Have you considered
using Overlapped I/O with the port yet?
Gambit |
|
| Back to top |
|
 |
Ramy Guest
|
Posted: Sun Jul 23, 2006 4:24 pm Post subject: Re: Strange 'WriteFile' Freezing problem |
|
|
Hi, the timeouts that I use are the following -
read_timeout.ReadIntervalTimeout = 0;
read_timeout.ReadTotalTimeoutMultiplier = 150;
read_timeout.ReadTotalTimeoutConstant = 150;
read_timeout.WriteTotalTimeoutMultiplier = 0;
read_timeout.WriteTotalTimeoutConstant = 150;
I asked the WriteFile command to send 8 bytes, and the size of
my TxBuff[] is 250 bytes.
Any Idea ?
"using Overlapped I/O with the port"
What does it do? do you have an example? is it complicate?
Thanks!
| Quote: | How much data are you actually sending? What kind of device is on the other
end of the port? What kind of timeouts are you using? Have you considered
using Overlapped I/O with the port yet?
Gambit |
|
|
| Back to top |
|
 |
Guest
|
Posted: Sun Jul 23, 2006 4:26 pm Post subject: Re: Strange 'WriteFile' Freezing problem |
|
|
Sorry the timeouts are -
read_timeout.ReadIntervalTimeout = 0;
read_timeout.ReadTotalTimeoutMultiplier = 0;
read_timeout.ReadTotalTimeoutConstant = 150;
read_timeout.WriteTotalTimeoutMultiplier = 0;
read_timeout.WriteTotalTimeoutConstant = 150; |
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Mon Jul 24, 2006 12:00 am Post subject: Re: Strange 'WriteFile' Freezing problem |
|
|
"Ramy" <Ramy (AT) NoMail (DOT) com> wrote in message
news:44c35c6a$1 (AT) newsgroups (DOT) borland.com...
| Quote: | Hi, the timeouts that I use are the following -
|
These are the timeouts that I use:
read_timeout.ReadIntervalTimeout = 0;
read_timeout.ReadTotalTimeoutMultiplier = 5;
read_timeout.ReadTotalTimeoutConstant = 5000;
read_timeout.WriteTotalTimeoutMultiplier = 5;
read_timeout.WriteTotalTimeoutConstant = 1000;
| Quote: | I asked the WriteFile command to send 8 bytes, and the size of my TxBuff[]
is 250 bytes. |
What buffer sizes are you specifying in SetupComm()? What DBC values are
you specifying in SetCommState()?
You did not answer my earlier question:
"What kind of device is on the other end of the port?
If the device is having problems reading, and you are using any kind of flow
control, that might explain why your writing is freezing periodically.
| Quote: | "using Overlapped I/O with the port"
What does it do? do you have an example? is it complicate?
|
Overlapped Operations
http://msdn.microsoft.com/library/en-us/devio/base/overlapped_operations.asp
Gambit |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|