Link to home
Start Free TrialLog in
Avatar of aurelia
aurelia

asked on

Winsock control TCP/IP data arrival event

A current project has required me (old MF BAL programmer, but Visual Basic beginner) to connect a Windows NT PC applcation to an IBM mainframe CICS application using TCP/IP.  I have successfully accomplished this via Visual Basic using the Winsock control on the PC.  However, one surprise was that in the executable version of the code  (not in the development mode), when data arrived from the MF, and I popped a Msgbox in the data arrival event, the box would display, but if more MF data arrived, Windows would again  fire  the data arrival event  resulting in two or more events processing through the same data arrival event code simultaneously.  My question is, using the Winsock control, when is the data arrival event triggered by Windows, and is there anyway to tell Windows to wait until the current data being processed is completed  (End of data arrival sub) before firing a new data arrival event?  Thanks!  
Avatar of cognition
cognition

You will need to code a queue, or to process the data as soon as it arrives.

I have done this using a list box. All new data is added to the end of the listbox, and a timer takes the first item in the list box, and processes it. More data arriving is added to the listbox as it arrives.

Having message boxes, or modal forms appear can cause problems if they prevent processing of the arriving data.

The only way round, is to set up some sort of protocol, to ask for more data, and to ask to stop sending.

Avatar of aurelia

ASKER

Thanks, for confirming my MsgBox problem and your great solution to get around the problem.  I would like to accept your answer as excellant, but would still like the following answered.

Using the Winsock control, WHEN is the data arrival event triggered by Windows, and IS THERE anyway to tell Windows to wait until the current data being processed is completed  (End of data arrival sub) before firing a new data arrival event? 
ASKER CERTIFIED SOLUTION
Avatar of kianwei
kianwei

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
i am not sure this method that i mentioned above really u or not..
hopefully it's really help u, thanks.