stuck on Listen()
my first app was a Pong clone using TCP/IP.
It worked great for the most part, except for one bug.
If no clients connect to the server, the server will simply Listen() indefinitely. Nothing will work except a hard-reboot/reset button.
what is a way around this?
non-blocking sockets ![](wink.gif)
Although, I''m surprised that you were able to make networked Pong with blocking sockets!
![](wink.gif)
Although, I''m surprised that you were able to make networked Pong with blocking sockets!
How does listen() lock the server? Are you referring to some kind of loop that makes calls to WSAAccept() for incoming clients?
Kuphryn
Kuphryn
yes, thats exactly what i did.
since this version of network pong is a server client setup (with a max of 1 client) it is essentially a peer-to-peer in the end.
the server listens(), and when it received a connect request, it accepts. then, and only then, will the game begin or quit.
since this version of network pong is a server client setup (with a max of 1 client) it is essentially a peer-to-peer in the end.
the server listens(), and when it received a connect request, it accepts. then, and only then, will the game begin or quit.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement