Hello
I need to set up a socket connection and send some data, in a lot of cases, a response is expected. I want a blocking request.
What I want, is to use this code:
FetchMyData should send some info over a socket, wait for a response and return the data.
I have 2 problems:
So, it is possible to turn a resumeable sub in a normal sub? Maybe with a middlemen function or anything?
Thanks for any input or ideas.
I need to set up a socket connection and send some data, in a lot of cases, a response is expected. I want a blocking request.
What I want, is to use this code:
B4X:
Dim MyData As String = FetchMyData("please")
FetchMyData should send some info over a socket, wait for a response and return the data.
I have 2 problems:
- The AsyncStream event isn't tied to a specific command I'm sending. Can I send a command and use Wait For?
- If answer on the above is Yes, is it possible to wait for the command and then return the data without being a resumable sub?
So, it is possible to turn a resumeable sub in a normal sub? Maybe with a middlemen function or anything?
Thanks for any input or ideas.