Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Broadcasting a Server  (Read 20207 times)

0 Members and 1 Guest are viewing this topic.

Pwndja

  • Jr. Member
  • **
  • Posts: 54
    • View Profile
Broadcasting a Server
« on: July 24, 2008, 08:28:58 pm »
If I want to have a server broadcast its IP address to my clients how would I go about doing this.
I am using UDP sockets. I want to be able to have a server running and wait for clients to connect to it, but I don't want the client side to have a static server IP address in my code, instead I would like to have the client find the server's address.
Another thing is it only has to find the server on a LAN NOT through the internet or a DNS name.

any advice or help is much appreciated.

Thanks in advance

Daazku

  • Hero Member
  • *****
  • Posts: 896
    • View Profile
Broadcasting a Server
« Reply #1 on: July 25, 2008, 02:24:07 am »
Arg ... The best solution is through a DNS XD.
Pensez à mettre le tag [Résolu] une fois la réponse à votre question trouvée.
Remember to add the tag [Solved] when you got an answer to your question.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Broadcasting a Server
« Reply #2 on: July 25, 2008, 02:55:10 am »
Don't know if it's the most efficient solution, but you can send a particular message on a particular port to the whole LAN (using UDP broadcasting), and wait for a reply from the server indicating its address.
Laurent Gomila - SFML developer

Mindiell

  • Hero Member
  • *****
  • Posts: 1261
    • ICQ Messenger - 41484135
    • View Profile
Broadcasting a Server
« Reply #3 on: July 25, 2008, 06:36:28 am »
This is the only solution on a LAN. You can only reach a server on the same address type than your IP. Today, each network interface can block the Broadcast and usually do it, so you have to stay on your little network.

An other idea is to show the server IP on the server screen when the app runs, and each client can know it easily (since a LAN is often on small areas).
Mindiell
----

e_barroga

  • Jr. Member
  • **
  • Posts: 76
    • View Profile
Broadcasting a Server
« Reply #4 on: August 27, 2008, 04:03:22 am »
The easiest way I know is making a dedicated master server that keeps track of people that host games. Then the people that join communicate with the master server to determine if an existing game is present.

 

anything