Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Client/Server Application - Locating Server on Network

Client/Server Application - Locating Server on Network

Scheduled Pinned Locked Moved Visual Basic
csharpsysadminhelpwpfwinforms
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Dominick Marciano
    wrote on last edited by
    #1

    I am currently writing a business application which is a collaborative tools (e.g. messaging, file sharing, reminders, etc.) which uses a client/server model. One thing I'm currently stuck on is how the client application can locate the server without requiring each user to enter the IP address in their own application. From research I've done, it appears that there are two ways this can be accomplished. 1. I can require that the system admin (who installs the server application) to create an A record for the server and then create an SRV record which would list the port and the hostname (from the A record). However this would require the network to have a DNS server. 2. I can use IP multicasting. On a predefined port, the server can send out a message at regular intervals which contains its IP address and the port to connect on. When the client application starts up, and during login, the client application can listen for this message to determine where the server is located. If the second option is viable, any suggestion on how often the multicast message should be sent out? It should be often enough that by the time the client application has finished loading, and the user has begun the login process, it has already identified the local server. However, I'm worried about sending it too often and causing network congestion. I am leaning towards option two as it doesn't require any DNS records to be updated and seems to be easier for whoever installs the server application. I was wondering if anyone else has had to do something similar and had any suggestions on either of these two methods, or any other method that may work better. Please note that I am using .NET 4.6, server application is a windows forms application, and the client application is being designed with WPF; WCF is not being used for this project. Any comments or suggestions would be greatly appreciated. Thank you in advance for any help in this matter. -Dominick

    A black hole is where God tried to divide by zero. There are 10 kinds of people in the world; those who understand binary and those who don't.

    L B D 3 Replies Last reply
    0
    • D Dominick Marciano

      I am currently writing a business application which is a collaborative tools (e.g. messaging, file sharing, reminders, etc.) which uses a client/server model. One thing I'm currently stuck on is how the client application can locate the server without requiring each user to enter the IP address in their own application. From research I've done, it appears that there are two ways this can be accomplished. 1. I can require that the system admin (who installs the server application) to create an A record for the server and then create an SRV record which would list the port and the hostname (from the A record). However this would require the network to have a DNS server. 2. I can use IP multicasting. On a predefined port, the server can send out a message at regular intervals which contains its IP address and the port to connect on. When the client application starts up, and during login, the client application can listen for this message to determine where the server is located. If the second option is viable, any suggestion on how often the multicast message should be sent out? It should be often enough that by the time the client application has finished loading, and the user has begun the login process, it has already identified the local server. However, I'm worried about sending it too often and causing network congestion. I am leaning towards option two as it doesn't require any DNS records to be updated and seems to be easier for whoever installs the server application. I was wondering if anyone else has had to do something similar and had any suggestions on either of these two methods, or any other method that may work better. Please note that I am using .NET 4.6, server application is a windows forms application, and the client application is being designed with WPF; WCF is not being used for this project. Any comments or suggestions would be greatly appreciated. Thank you in advance for any help in this matter. -Dominick

      A black hole is where God tried to divide by zero. There are 10 kinds of people in the world; those who understand binary and those who don't.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Why make life more complicated than it needs to be? Just provide the IP address to each client in a configuration file.

      1 Reply Last reply
      0
      • D Dominick Marciano

        I am currently writing a business application which is a collaborative tools (e.g. messaging, file sharing, reminders, etc.) which uses a client/server model. One thing I'm currently stuck on is how the client application can locate the server without requiring each user to enter the IP address in their own application. From research I've done, it appears that there are two ways this can be accomplished. 1. I can require that the system admin (who installs the server application) to create an A record for the server and then create an SRV record which would list the port and the hostname (from the A record). However this would require the network to have a DNS server. 2. I can use IP multicasting. On a predefined port, the server can send out a message at regular intervals which contains its IP address and the port to connect on. When the client application starts up, and during login, the client application can listen for this message to determine where the server is located. If the second option is viable, any suggestion on how often the multicast message should be sent out? It should be often enough that by the time the client application has finished loading, and the user has begun the login process, it has already identified the local server. However, I'm worried about sending it too often and causing network congestion. I am leaning towards option two as it doesn't require any DNS records to be updated and seems to be easier for whoever installs the server application. I was wondering if anyone else has had to do something similar and had any suggestions on either of these two methods, or any other method that may work better. Please note that I am using .NET 4.6, server application is a windows forms application, and the client application is being designed with WPF; WCF is not being used for this project. Any comments or suggestions would be greatly appreciated. Thank you in advance for any help in this matter. -Dominick

        A black hole is where God tried to divide by zero. There are 10 kinds of people in the world; those who understand binary and those who don't.

        B Offline
        B Offline
        Bernhard Hiller
        wrote on last edited by
        #3

        Dominick Marciano wrote:

        server application is a windows forms application

        Are you sure? Really sure? That means that someone has to log in to that server and start that application in his user session. It cannot be run as a Windows Service anymore. And just imagine the server being re-started (e.g. because of updates): your server application won't be restarted. Or: the user in whose session the application is running logs off (instead off disconnects the RDP session), or ....

        1 Reply Last reply
        0
        • D Dominick Marciano

          I am currently writing a business application which is a collaborative tools (e.g. messaging, file sharing, reminders, etc.) which uses a client/server model. One thing I'm currently stuck on is how the client application can locate the server without requiring each user to enter the IP address in their own application. From research I've done, it appears that there are two ways this can be accomplished. 1. I can require that the system admin (who installs the server application) to create an A record for the server and then create an SRV record which would list the port and the hostname (from the A record). However this would require the network to have a DNS server. 2. I can use IP multicasting. On a predefined port, the server can send out a message at regular intervals which contains its IP address and the port to connect on. When the client application starts up, and during login, the client application can listen for this message to determine where the server is located. If the second option is viable, any suggestion on how often the multicast message should be sent out? It should be often enough that by the time the client application has finished loading, and the user has begun the login process, it has already identified the local server. However, I'm worried about sending it too often and causing network congestion. I am leaning towards option two as it doesn't require any DNS records to be updated and seems to be easier for whoever installs the server application. I was wondering if anyone else has had to do something similar and had any suggestions on either of these two methods, or any other method that may work better. Please note that I am using .NET 4.6, server application is a windows forms application, and the client application is being designed with WPF; WCF is not being used for this project. Any comments or suggestions would be greatly appreciated. Thank you in advance for any help in this matter. -Dominick

          A black hole is where God tried to divide by zero. There are 10 kinds of people in the world; those who understand binary and those who don't.

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          Why go with only one method? No matter what, you're going to have to do some setup on the server side. There are going to be clients who don't want your "here I am!" packets polluting their network every 10 seconds or so. These can also be spoofed by the way which is a security risk. There are also clients who are going to want that method for ease of configuration. You can also support the DNS approach but you're still going to have to support manual entry of the address the user wants to use, such as in a situation where they have more than one server up and running, possible one for production use and another for testing. Now you've got to let the users choose which server. Possibly limiting that the admin setting only, ... There's a LOT more to this than what you're thinking about in your question.

          A guide to posting questions on CodeProject

          Click this: Asking questions is a skill. Seriously, do it.
          Dave Kreskowiak

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups