Welcome,
Guest
. Please
login
or
register
. Did you miss your
activation email?
French forum
Home
Help
Search
Login
Register
SFML community forums
»
Help
»
Network
»
Stopping a socket in blocking mode
Print
Pages: [
1
]
Author
Topic: Stopping a socket in blocking mode (Read 1906 times)
0 Members and 1 Guest are viewing this topic.
LemonLake
Newbie
Posts: 1
Stopping a socket in blocking mode
«
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?
Logged
Laurent
Administrator
Hero Member
Posts: 32498
Re: Stopping a socket in blocking mode
«
Reply #1 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.
Logged
Laurent Gomila - SFML developer
Print
Pages: [
1
]
SFML community forums
»
Help
»
Network
»
Stopping a socket in blocking mode