I am using the winsock control in vb6 to check the availability of a web service.
I do a post request, get the response and parse the response header to check the response code.
The response arrives in multiple packets.
' this event occurs when data is arriving via winsock
Private Sub wsTCP_DataArrival(ByVal bytesTotal As Long)
Dim strResponse As String
wsTCP.GetData strResponse, vbString, bytesTotal
strResponse = FormatLineEndings(strResponse)
' we append this to the response box becuase data arrives
' in multiple packets
response = response & strResponse
End Sub
My problem is that I need to wait until I check the response code to continue execution.
Is there any way to do this without using a timer?
Thanks,
Alex
decided to use the timer after all.
Every time you receive data, append onto a buffer then process/parse that.
It gets around having to use the blocking sockets and means you can react when it arrives.
See this article on network protocols for an example.