Hi, I ame trying to do some network communication and I don't understand one thing. How am I actually supposed to use the waitForNextConnection () method. I was trying hard to find anything on the topic but with no luck. Everybody seems to discuss UDP stream here. Does anybody even use the StreamingSocket?
Calling the waitForNextConnection() blocks until some connection is estabilished. The obvious problem is, what if no connection is ever made? Even if I move it to a separate thread (which I did), the function blocks until, well, forever. And I have no way of exiting the thread cleanly.
What am I missing?
By the way, I know about InterprocessConnection, but I cannot use it (I think) as there is not going to be JUCE application on the other end in the future.
Yes, I know and understand. I have written a demo application and it works. The only thing I don't like is having to kill the thread by force if no connection was made - i.e. the server thread is still stuck in waitForNextConnection().
This is the implementaion for a normal socket listener.
What do you mean? There's no such implementation in JUCE. I made that up and I said I would like to have such a function. waitForNextConnection has no timeout parameter.
If I understand it correctly I would have to have a JUCE application on both end of the connection to use ChildProcess class, right? On one side I am going to have JUCE application running on Android and on the other side there is going to be some serial over WiFi bridge, so I guess I'll have stick with StreamingSocket and write my own keepalive messaging...
Would someone mind elaborating on this? Specifically elli’s post diagramming the thread. Where do I implement the code to signal an exit and close the socket? Thanks for the help.