Possibly I need to send several "simultaneous" requests to the server and then I would need to know the response of this to each of them. The problem that the server is not "mine" and only responds with an Ok. With which I have no way of knowing which one he really responded to.
I guess I would have to do it with some kind of queue and always send one at a time and wait for the server to respond to send the next one.
But with the wait for I think I could solve it easily. Hence my question.
Downloading resources is simpler with the new Resumable Subs feature. Using Wait For we can wait for the JobDone event in the same sub that started the download. No longer is it needed to have a single sub that handles all requests results. Simplest example: Dim j As HttpJob j.Initialize(""...
Downloading resources is simpler with the new Resumable Subs feature. Using Wait For we can wait for the JobDone event in the same sub that started the download. No longer is it needed to have a single sub that handles all requests results. Simplest example: Dim j As HttpJob j.Initialize(""...
Sub EnviarComando2(Comando As String)
Dim astAux As AsyncStreamsText
Try
Log("Enviando Comando2: " & Comando)
astAux.Initialize(Me, "", socketIn.InputStream, socketIn.OutputStream) 'initialize AsyncStreamsText with the socket streams.
astAux.Write(Comando & Chr(13) & Chr(10))
Wait For (astAux) EventName_NewText (Text As String)
Log("Enviado Comando2: " & Comando)
Catch
Log("Enviar Comando2: " & Comando & LastException.Message)
End Try
End Sub
The write does it correctly, since in the server log I see that it receives it.
But it never "returns" from the wait for.
Is it a problem with the name of the event or something like that?
From the Resumable Subs tutorial: " If the event is never raised then the sub will never be resumed. The program will still be completely responsive. "
Exists the EventName_NewText event?