Quantcast
Channel: Processing Forum
Viewing all articles
Browse latest Browse all 1768

Re : Is there a way to use Client.readString() propperly outside of the draw() function?

$
0
0
The setup() method is executed at once. You send a request and immediately try to get the answer, but it will take a while before the server answers, so the response isn't available right now.
That's why Client example put the code in draw(), because it can scan regularly if there is a response.
Just add noLoop() after you get the response, and you have the best of both worlds. Alternatively, you can spawn a new thread to poll the response, but you will just do the same work than draw()...

Viewing all articles
Browse latest Browse all 1768

Trending Articles