I make requests:
HTTPRequest(#PB_HTTP_Get, "http://127.0.0.1/query.php?nr=1", @HttpGetEvent())
HTTPRequest(#PB_HTTP_Get, "http://127.0.0.1/query.php?nr=2", @HttpGetEvent())
HTTPRequest(#PB_HTTP_Get, "http://127.0.0.1/query.php?nr=3", @HttpGetEvent())
HTTPRequest(#PB_HTTP_Get, "http://127.0.0.1/query.php?nr=4", @HttpGetEvent())
depends server load, files may come in other order, example:
3
1
2
4
If i make several queries in succession, the files(answers) from servers may come in other order. How i can make http request command, that
not return until file is received. Or is there some other method to receive files in right order?
Shortly, i need synchronous query, is that possible?
Thanks
Raimo
HTTPRequest return order
Re: HTTPRequest return order
I resolved this question with making my own buffer, that will not send next message, until lastone returned
Re: HTTPRequest return order
perhaps like this way (untested):
Greetings ... Peter
Code: Select all
Procedure HttpGetEvent(...
Static nbRequests = 1
[YourCode]
nbRequests + 1
If nbRequests < 5
HTTPRequest(#PB_HTTP_Get, "http://127.0.0.1/query.php?nr=" + Str(nbRequests), @HttpGetEvent())
EndIf
EndProcedure
HTTPRequest(#PB_HTTP_Get, "http://127.0.0.1/query.php?nr=1", @HttpGetEvent())