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. C#
  4. My Network Service Finder is sooooo sloooww

My Network Service Finder is sooooo sloooww

Scheduled Pinned Locked Moved C#
sysadminhelpquestion
5 Posts 3 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.
  • S Offline
    S Offline
    Silvyster
    wrote on last edited by
    #1

    I created a client-server application where I installed the client on 10 computers in a network (LAN)... now since the IP address of each computer are dynamic.. I created my server in such a way that I will scan the network from something like 192.168.1.1 to 192.168.1.255 just to find those 10 computers. It works, it was able to detect the 10 computers which is running the specific service.. My problem is that the detection is too slow.. starts from 192.168.1.1 (30 seconds) then 192.168.1.2 (another 30 seconds) so like an average of 30 seconds for each IP... is there a way to fasten this up?

    D S 3 Replies Last reply
    0
    • S Silvyster

      I created a client-server application where I installed the client on 10 computers in a network (LAN)... now since the IP address of each computer are dynamic.. I created my server in such a way that I will scan the network from something like 192.168.1.1 to 192.168.1.255 just to find those 10 computers. It works, it was able to detect the 10 computers which is running the specific service.. My problem is that the detection is too slow.. starts from 192.168.1.1 (30 seconds) then 192.168.1.2 (another 30 seconds) so like an average of 30 seconds for each IP... is there a way to fasten this up?

      D Offline
      D Offline
      DaveyM69
      wrote on last edited by
      #2

      I'm not sure if there's a 'proper' way. Have you tried pinging the addresses first to see if they exist? I would be testing several at once using threading too.

      Dave
      BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
      Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)

      S 1 Reply Last reply
      0
      • D DaveyM69

        I'm not sure if there's a 'proper' way. Have you tried pinging the addresses first to see if they exist? I would be testing several at once using threading too.

        Dave
        BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
        Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)

        S Offline
        S Offline
        Silvyster
        wrote on last edited by
        #3

        I am only running the scan on a single thread and i'm planning to create more... Regarding the "detection" if the IP exists on the network... how do i do that? i used the Dns.getHostByAddress but it seems like it failed.

        1 Reply Last reply
        0
        • S Silvyster

          I created a client-server application where I installed the client on 10 computers in a network (LAN)... now since the IP address of each computer are dynamic.. I created my server in such a way that I will scan the network from something like 192.168.1.1 to 192.168.1.255 just to find those 10 computers. It works, it was able to detect the 10 computers which is running the specific service.. My problem is that the detection is too slow.. starts from 192.168.1.1 (30 seconds) then 192.168.1.2 (another 30 seconds) so like an average of 30 seconds for each IP... is there a way to fasten this up?

          S Offline
          S Offline
          Schmuli
          wrote on last edited by
          #4

          In the System.Net.NetworkInformation namespace, there is a Ping object, that can ping either an IP address, or a host-name (the name of the computer). Use the Ping.Send( string ) or Ping.Send( IPAddress ) methods and get a PingReply object with details about the host or address pinged. See

          1 Reply Last reply
          0
          • S Silvyster

            I created a client-server application where I installed the client on 10 computers in a network (LAN)... now since the IP address of each computer are dynamic.. I created my server in such a way that I will scan the network from something like 192.168.1.1 to 192.168.1.255 just to find those 10 computers. It works, it was able to detect the 10 computers which is running the specific service.. My problem is that the detection is too slow.. starts from 192.168.1.1 (30 seconds) then 192.168.1.2 (another 30 seconds) so like an average of 30 seconds for each IP... is there a way to fasten this up?

            S Offline
            S Offline
            Schmuli
            wrote on last edited by
            #5

            In the System.Net.NetworkInformation namespace, there is a Ping object, that can ping either an IP address, or a host-name (the name of the computer). Use the Ping.Send( string ) or Ping.Send( IPAddress ) methods and get a PingReply object with details about the host or address pinged. See How to ping a hostname/ip using ASP.NET 2.0 and C# .NET[^] for an example of using the Ping and PingReply objects.

            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