Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21722

[RESOLVED] How to wait until a connection has been made and the server has sent data

$
0
0
A application connects to a server. Then the server sends the application some data. Once the data has been received and verified then the application can continue on with normal processing.

If I set up a wait loop it doesn't work, like this:

Code:

  '
  '
 SocketForServer.Close
 SocketForServer.Connect "localhost", 1370
 
 WaitOnServer = True

 Do While WaitOnServer
  DoEvents
 Loop
  '
  '

The connection is made. I know that for sure.

The DataArrival event is never fired so I can't set the WaitOnServer indicator to False

If I remove the loop it works but then it's too soon to continue processing since the app continues on without the data it needs from the server

Viewing all articles
Browse latest Browse all 21722

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>