Sign in to follow this  

Getting available server list for a LAN game?

This topic is 3575 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
Weak answer from what I can recall:

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).

See this wiki article, should explain it better.

Share this post


Link to post
Share on other sites
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

This topic is 3575 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this