I have been using the Winsock control for some time in my vb applications and have had no problems however just recently i have found that one of my winsock controls' events gets fired BEFORE it is supposed to. More specifically, when i use the .Connect() function for this control it goes into a .State = 6 (Connecting) when this happens the control fires the event Data_Arrival() with 23 bytes (i believe) of data that has arrived DESPITE still being in "Connecting" state. Shouldn't the control be in a "Connected" (state=7) state BEFORE windows auto triggers its Data_Arrival() event? Anyway, when this "strange" data does arrive within this event procedure i use the .GetData() function and windows pops up an error indicating that the control is NOT in the correct state to receive this data yet (it is still in State = 6 mode -- Connecting).
HOW THE HECK IS THIS POSSIBLE? CAN SOMEONE TELL ME HOW IT IS DOING THIS AND HOW I CAN RESOLVE IT?
Btw, i have this control on a form and i make multiple instances of this form (i have done this with many other apps in the past with no problems but i just wanted to let you know).
Hey, could it be that because i make a Connection to a remote site at a specific IP address (the port may change -- or it might be the same some times i guess) and then i shut down the connection via just hitting VB's STOP APP button or telling the remote side to cut the connection does some data linger in "limbo" so that when i restart the app and the connection is "reestablishing" (not quite yet fully connected) the remaining "Limbo" data is arriving now to me?