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. Socket programming

Socket programming

Scheduled Pinned Locked Moved C#
sysadmincsharp
5 Posts 5 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.
  • A Offline
    A Offline
    AlexPizzano
    wrote on last edited by
    #1

    Writing C# program to search through network for existing listening server's ip addresses and port numbers assuming that ip address and port number for the server was not known.

    G S D N 4 Replies Last reply
    0
    • A AlexPizzano

      Writing C# program to search through network for existing listening server's ip addresses and port numbers assuming that ip address and port number for the server was not known.

      G Offline
      G Offline
      Gareth H
      wrote on last edited by
      #2

      loke6258038, And what help do you need? or do you want someone to give you a complete program?

      Regards, Gareth. (FKA gareth111)

      1 Reply Last reply
      0
      • A AlexPizzano

        Writing C# program to search through network for existing listening server's ip addresses and port numbers assuming that ip address and port number for the server was not known.

        S Offline
        S Offline
        Shuaib wasif khan
        wrote on last edited by
        #3

        system.net namespace will be helpful for you you can use tcpclient and tcplistner class for your purpose tips: also use socket,networkstream classes

        1 Reply Last reply
        0
        • A AlexPizzano

          Writing C# program to search through network for existing listening server's ip addresses and port numbers assuming that ip address and port number for the server was not known.

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

          General idea...

          bool success;
          //Iterate through every possible LAN IP address...
          //Iterate through every possible Port...
          try
          {
          // attempt to connect TCP
          success = true;
          break;
          }
          catch
          {
          // not valid
          }
          try
          {
          // attempt to connect UDP
          success = true;
          break;
          }
          catch
          {
          // not valid
          }
          if(success) break;
          //
          //

          NB: This will take forever to run unless you're VERY lucky!

          Dave

          1 Reply Last reply
          0
          • A AlexPizzano

            Writing C# program to search through network for existing listening server's ip addresses and port numbers assuming that ip address and port number for the server was not known.

            N Offline
            N Offline
            nelsonpaixao
            wrote on last edited by
            #5

            Search all the web for servers? of what kind? what is your goal?

            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