Jump to content
  • Advertisement
Sign in to follow this  
CuppoJava

Getting available server list for a LAN game?

This topic is 3937 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

Hi, I'm programming a masterserver-ish thing for LAN playing for my game, but I'm a little stuck on how it works. If someone could point me in the right direction i'd be very grateful. On a LAN connection, any computer can host a game and create a server. Other computers should be able to see a list of all available game servers to connect to. For an internet game, I'm using a masterserver to keep a list of all the available servers. But how would you do it for a LAN game? Thanks a lot -Cuppo PS: On a side-note: When I send messages using TCP does TCP automatically package many packages together to decrease on header size? eg... If I send a thousand single byte packets, does TCP automatically bunch them together for me?

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Owl stretcher
You can let a server periodically broadcast messages via sending packets to 255.255.255.255. This will send messages to all peers on LAN I believe. Exactly how it works with TCP or UDP I cannot say, because I haven't been using these protocols directly (free network abstraction layers ftw).

There is no TCP broadcast, so it can only be done with UDP.

Share this post


Link to post
Share on other sites
Thanks for the help guys.
I wanted to hold off on implementing UDP and getting reliable in-order TCP packets to work first... but it seems I have no choice now. Anyway, thanks for pointing me in the right direction.

Share this post


Link to post
Share on other sites
Quote:
Original post by CuppoJava
I wanted to hold off on implementing UDP and getting reliable in-order TCP packets to work first... but it seems I have no choice now.

You can use UDP broadcast to locate the other machines, and then use TCP for communication once they have been found.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!