|
-
Nov 17th, 2000, 11:07 AM
#1
Thread Starter
New Member
Does anybody have code for receiving a large (118K) binary file using MSCOMM.
I can send the file, but I'm having a heck of a time trying to receive it - always get buffer overflow (buffer is set at max already)
-
Nov 17th, 2000, 01:30 PM
#2
Addicted Member
Hi,
why don't you use hardware flow control ?
Here is what I would do or try :
You need to modify your send programm to stop sending bytes if the CTSHolding property of mscomm goes low (logical 0).
Start back when property goes high again...
From your receiving programm, set RTSEnable high (logical 1) when you are ready to receive Data. This will change the state of the send program's CTS line and it will start sending data.
I suggest that you stop sending bytes when the receivers buffer is about 80-85 % full then start back when it's back to 10-15 % full. This means the receiver has to check for it's buffers not to overflow, and if needed stop the byte sending sequence of the sender...still with me ?
P.S. I even wonder if just setting the hardware flow control to true may toggle all control signal by itself and then you only have to react to events.... take a look at that first !
Reply if help needed...
[Edited by *Vince on 11-17-2000 at 01:39 PM]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|