locked
Clients are able to discover Servers without entering IP details RRS feed

  • Question

  • Here's a scenario i'm looking at;

    I have many clients and many servers, the clients are able to select which server to connect too. Servers will be going offline/online at any point. They may come back on with different details (such as ip address, computer name) so the client need to be able to discover the servers without relying on IP/Computer Name.

    Is this possible? and if so what or where do i need to start?

    Thursday, December 6, 2012 3:15 PM

All replies

  • I've found a few items that could be the right solution;

    Firstly using the broadcast address ala > http://blog.eviac.com/2010/12/network-broadcasting-with-c.html

    Secondly using something like zeroconf.

    Before i start to go down one of these roads, which would be best?

    Thursday, December 6, 2012 3:34 PM
  • I can see the IP address changing when DNS is used on a subnet.  The computer name should never change.  The server role may change.  I different computer may take over the role of the server.  You would need to have the server broadcast a message to all clients indicating which computer is acting as the server.  So the server would send out a Multicast message over the subnet on a particular port number a message indicating the server Name or IP address.  Then have the clients listen for the multicast message before connecting to the server.

    jdweng

    Thursday, December 6, 2012 3:37 PM
  • There would be multiple servers, so i'm guessing they would all need to broadcast. The client's would then get a list of servers and would be able to select one.
    Thursday, December 6, 2012 4:13 PM
  • Yes you could have multiple servers broadcasting on the same multicast port number.  You could also have one server allowing client to connect and the other as backups.  You could impliment something like a Token/Ring archecture.  The Ring would be all servers and the Token would be that is presently being accepting the connections from the client.

    jdweng

    Thursday, December 6, 2012 4:24 PM
  • Cool, the multiple server's isn't for redundancy etc. It's to allow client's to talk to Teacher's PC's (one in each classroom).


    Ona side note, does anyone know of a bonjour implementation that's Windows 8 Modern UI friendly (aka Metro)?

    Thursday, December 6, 2012 4:31 PM
  • Multicast IP addresses are in the range 224.X.X.X. to 239.X.X.X for IPv4 and 224.X.X.X.X.X to 239.X.X.X.X.X for IPv6.  The following codeproject implioments multicast on a Window 8 PC.

    http://www.codeproject.com/Articles/458807/UPnP-code-for-Windows-8


    jdweng

    Thursday, December 6, 2012 4:45 PM