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:
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?
For ease for the end user, I would really love the fact that the user can call FetchMyData("please") and not Wait For (FetchMyData("please")) Complete (MyData As String)
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.