Railu
August 18th, 2009, 02:40 AM
I've created a very basic multiplayer game but as it stands, you need to manually type in the host address to join a game. So if player 1 launches a server, the other clients type "connect x.x.x.x" and it works. But I would like more. I've been thinking about how I can check whether there is a server waiting for connections on a given network.
Most multiplayer games don't require you know the exact IP address of the host to connect. Does anyone know how to do that? Since I am still relatively inexperienced in Winsock and networking in general, I really have no knowledge of how to do this. Most of my knowledge has come from a course I took a few years back and a handful of tutorials. I've searched quite a bit, but almost all articles and tutorials only address what to do once you've established a connection.
Sorry if this seems inane. If it's as complicated as I am assuming it is, in lieu of an explanation (although preferred), I will accept a good book on the subject.
Edit: The only idea I can think of is testing each IP (x.x.x.1 to x.x.x.255) using the specified port until I get a response. But I can think of no other way without more advanced knowledge.
Most multiplayer games don't require you know the exact IP address of the host to connect. Does anyone know how to do that? Since I am still relatively inexperienced in Winsock and networking in general, I really have no knowledge of how to do this. Most of my knowledge has come from a course I took a few years back and a handful of tutorials. I've searched quite a bit, but almost all articles and tutorials only address what to do once you've established a connection.
Sorry if this seems inane. If it's as complicated as I am assuming it is, in lieu of an explanation (although preferred), I will accept a good book on the subject.
Edit: The only idea I can think of is testing each IP (x.x.x.1 to x.x.x.255) using the specified port until I get a response. But I can think of no other way without more advanced knowledge.