Archived

This topic is now archived and is closed to further replies.

Finding games over a LAN via WinSock

This topic is 6551 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

In my multiplayer game I have it working fine if you enter the IP of the server but DirectPlay has the ability to ''search for local games'' in TCP/IP over a LAN. Does anyone know how to accomplish this with WinSock 2.x?

Share this post


Link to post
Share on other sites
Just create a socket to listen to the broadcast address for the subnet that the computer is on. Then the game server sends packets to the broadcast address.

Share this post


Link to post
Share on other sites
The client broadcasts a UDP packet and then the server responds. We don''t want the server wasting network bandwidth broadcasting continuously if there are not clients interested in connecting.

Share this post


Link to post
Share on other sites