tchart Well-Known Member Licensed User Longtime User Jul 24, 2012 #1 Not sure if this is possible or not, Ive tried several methods but none seem to work. I would like to call a sub/function which fires off an HTTP request and then synchronously gets the response which is returned to the caller from the sub/function. Something like this; Code: Copy Dim resp as string resp = SynchronousGet("www.google.com") I don't want to have to rely on a call back sub as I need the call to happen "in line" with what I'm doing. Ive tried using a class module with a wait/sleep function but the call back from the httpclient only gets fired once my wait/sleep loop times out (I'd imagine it'd loop forever if I didnt have a time out) Is this even possible under Android or should I rethink my approach? Thanks
Not sure if this is possible or not, Ive tried several methods but none seem to work. I would like to call a sub/function which fires off an HTTP request and then synchronously gets the response which is returned to the caller from the sub/function. Something like this; Code: Copy Dim resp as string resp = SynchronousGet("www.google.com") I don't want to have to rely on a call back sub as I need the call to happen "in line" with what I'm doing. Ive tried using a class module with a wait/sleep function but the call back from the httpclient only gets fired once my wait/sleep loop times out (I'd imagine it'd loop forever if I didnt have a time out) Is this even possible under Android or should I rethink my approach? Thanks
tchart Well-Known Member Licensed User Longtime User Jul 24, 2012 #2 Apologies, looks like this has been answered here already; http://www.b4x.com/forum/basic4andr...nchronous-call-through-socket.html#post103620 Upvote 0
Apologies, looks like this has been answered here already; http://www.b4x.com/forum/basic4andr...nchronous-call-through-socket.html#post103620