Hello everyone, this is my first post here

I am currently writing a Client/Server application. The client is written in visual basic 6 and runs under windows (of course), the server is written in C and is running on a linux box. My question revolves around how to handle a disparity between the way these two process data. In C under linux (and most systems), a recv() call is blocking. So it sits there until the data is sent. So if I called
bytes_recvd = recv(socket, &someint, sizeof(int)); It would
wait at that line of code until something is sent to the system. This is perfect for what I'm trying to do, where you send something, wait for a response, send something, wait for a response, etc... In VB, however, receipt of data triggers the DataArrival event, but the code runs happily along until this even occurs. Well, this poses a problem because what if I wanted to handle multiple receives and then send all those blocks of data to one function for processing? So say the server sent to the client in three separate sends:
Server->SENDING_USERID (a simple integer message)
Server->"username"
Server->"password"

In this case the DataArrival would be called three times, this wouldn't be a problem with blocking I/O, because you could do:

Winsock.GetData message
If message = SENDING_USERID Then
.....Winsock.GetData username
.....Winsock.GetData password
.....SubToHandleData(username, password)
End If

But the way VB works I can't do this without state variables and other crap. Is there another way to implement a form of blocking I/O, or am I coming at this all wrong? Visual Basic uses OO and event driven paradigms that I haven't quite gotten the hand of yet. If anybody can give me any tips it would be very helpful. Alsi I'll give more clarification if needed.

Thanks