msdn serial receive buffer size
Hi , every body!
I'm taking a small example of communicating through RS232 using CMSComm. But it got me to trouble.
It seems that the receive buffer is never cleared when I use m_Comm.GetInput(). I can achieve the data sent to COM port but the receive buffer gonna be full and overflow. I try to catch out what's going on by adding a byteCounter and surprisingly, the total bytes I receive is exactly the size of the receive buffer.
That is, if buffer'size is 9192, I can get 9192 bytes only till I get a receive buffer overflow event. A AfxMessage is popped up for warning. Click OK then I can receive 9192 bytes more before I get another overflow event. ( so I think when AFxMessage is popped up, the buffer is cleared )
Does anybody know whu the buffer is not cleared when I read it and how to solve??? Because I'm sending a quite big file through COM port ( typically bigger than the reasonable buffer's size - up to 1MB )
Thanks in advance!!!