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. Fast Port Scanner

Fast Port Scanner

Scheduled Pinned Locked Moved C#
helpquestion
4 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.
  • B Offline
    B Offline
    baerten
    wrote on last edited by
    #1

    Hi everybody, my application (A) opens a port 35000. An external application (B) has the possibility to connect on this port 35000. If the application A is launched 3-times it opens the port 35000, for the second the port 35001 and so far... Now i created a little tool to check which ports are open. a simple loop which increments the Portnumber from 30000 to 30256. But it takes 1 second for each port, so more than 256 seconds for all these possible ports... In the loop i make each time a

    new IPEndPoint(...

    and

    new Socket(....

    Does it run faster in asynchronous mode? Big thanks for help :)

    L S 2 Replies Last reply
    0
    • B baerten

      Hi everybody, my application (A) opens a port 35000. An external application (B) has the possibility to connect on this port 35000. If the application A is launched 3-times it opens the port 35000, for the second the port 35001 and so far... Now i created a little tool to check which ports are open. a simple loop which increments the Portnumber from 30000 to 30256. But it takes 1 second for each port, so more than 256 seconds for all these possible ports... In the loop i make each time a

      new IPEndPoint(...

      and

      new Socket(....

      Does it run faster in asynchronous mode? Big thanks for help :)

      L Offline
      L Offline
      leppie
      wrote on last edited by
      #2

      baerten wrote:

      Does it run faster in asynchronous mode?

      It should, just fire off each request in it's own thread.

      xacc.ide - now with TabsToSpaces support
      IronScheme - 1.0 beta 1 - out now!
      ((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x))

      B 1 Reply Last reply
      0
      • L leppie

        baerten wrote:

        Does it run faster in asynchronous mode?

        It should, just fire off each request in it's own thread.

        xacc.ide - now with TabsToSpaces support
        IronScheme - 1.0 beta 1 - out now!
        ((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x))

        B Offline
        B Offline
        baerten
        wrote on last edited by
        #3

        Thanks for your reply. But it should also work in a easier way or not? All Port Scanner Tools works much faster. I can only test a port each second, thats very slow :-( So i open for each port a new thread which executes the work? Thanks to you

        1 Reply Last reply
        0
        • B baerten

          Hi everybody, my application (A) opens a port 35000. An external application (B) has the possibility to connect on this port 35000. If the application A is launched 3-times it opens the port 35000, for the second the port 35001 and so far... Now i created a little tool to check which ports are open. a simple loop which increments the Portnumber from 30000 to 30256. But it takes 1 second for each port, so more than 256 seconds for all these possible ports... In the loop i make each time a

          new IPEndPoint(...

          and

          new Socket(....

          Does it run faster in asynchronous mode? Big thanks for help :)

          S Offline
          S Offline
          Samer Aburabie
          wrote on last edited by
          #4

          Yes it should, since each request fires will not wait the previous one to complete, so multi of them will end up in the same time for example, in the addetion, there are two ways now to use asyncrounous calls with sockets now, the old one Begin/End aspect... and the new one which is introduced in .NET Framework 3.5, which is supposed to be faster and holds better performance ideas as well.

          Sincerely Samer Abu Rabie Note: Please remember to rate this post to help others whom reading it.

          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