🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Finding games over a LAN via WinSock

Started by
1 comment, last by Elixir 24 years, 4 months ago
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?
Advertisement
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.
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.

This topic is closed to new replies.

Advertisement