Dear Sir,
I have developed a Winsock control application for my office. It is working fine but facing a very triffle and interesting problem. I failed to solve it. Before plunging into it, a little bit idea of the application is essential to grab it correctly. Here it is.
The application is accepting Metereological data (Messages) in a serial fashion, once in every 6 hours for less than one second (Met data is coming in that fashion only), displying data in a text box, counting number of messages and sending these messages as it is to another machine which is running on LAN. It is then displaying sent messages in another text box and counting number of messages sent. Although some other small requirements also being performed by the application without any problem. Actually these data or messages are not possible to understand as these are only made up of large number of ascii characters. It is also not required to read the message, the destination machine understands all these messages. But there is a special character in the messages (small vertical rectangle type) which is marking the end of a message. I am counting the number of occurrance of that character and counting the number of messages accordingly. But when in use, the application counting the number of messages erratically (approximately 4 to 5 times the number of original messages). When I copy and paste messages in simulated environment (i.e. using two Hyper Terminals, one serving as Met client and another the destination machine, also a client), I am getting the count exactly. I tried storing messages in a variable and counting after one minute using a timer event to avoid instant counting while data_arrival event is executing, but in vain. Message receiving and sending is ok, only problem is counting. I am unable to find the reason for this erratic behaviour. Any suggestion will be highly appreciated. Sorry for explanation at length.

Regards,
- Ajoy Kumar Chakraborty