I am trying to use the Winsock Control in a class object.
My problem is trying to figure out the best way of detecting a response from the computer I am connecting to.
When I had a form using Winsock I waited on the DataArrival event.
Now that I am inside a class I can't placeCode:Private Sub mobjWinsock_DataArrival(ByVal bytesTotal As Long)
'Check for response from the remote host
mobjWinsock.GetData mvarResponse
End Sub
in the general section of the class so that the same object can be used throughout the class and then I would be able to watch for that event.Code:Set mobjWinsock = New MSWinsockLib.Winsock
Sooooo....
I could place
in the same sub that I create the winsock control, but this needs me to another question.Code:mobjWinsock.GetData mvarResponse
If a computer takes say 30 seconds to respond back how to I wait for the response then? Just placein a loop and say after 30 seconds or so in the loop error out if there is no response back? I don't know if I should keep issuing the GetData and what adverse affects it would cause.Code:mobjWinsock.GetData mvarResponse
Thanks for any help you can give.
[Edited by steve65 on 08-23-2000 at 09:39 AM]
