I created a tcp client in c++ and am using it in a blueprint. I call the receive function periodically with “set timer by function” block at 0.5 seconds. The receive function has a timeout of 1 ms, so it won’t block for long.
I am able to receive messages and act on them, but the rest of the program halts and is unresponsive while it is receiving messages. If I close the socket then the rest of the program runs ok.
How can I run a function in the blueprint periodically without blocking the rest of the program while it is waiting?
The TCP receive is only blocking for 1 ms. The set timer by function that is being used to trigger the receive twice a second is blocking the game thread… is there a non-blocking wait function?