SFML community forums

Help => Network => Topic started by: LemonLake on October 28, 2013, 02:02:18 pm

Title: Stopping a socket in blocking mode
Post by: LemonLake on October 28, 2013, 02:02:18 pm
I have a UDP socket running on a separate thread for the game server. When the host enters the quit command, it needs to stop the socket from the main thread. How do we do this?
Title: Re: Stopping a socket in blocking mode
Post by: Laurent on October 28, 2013, 02:36:38 pm
SFML provides no way to stop a waiting socket. The best solution is to use a socket selector with a timeout, so that you block only for a certain duration, and can perform periodic termination checks.