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 / C++ / MFC
  4. how to get port number

how to get port number

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
5 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.
  • P Offline
    P Offline
    p_
    wrote on last edited by
    #1

    hi all i want to know that how can i know the system port number as i need it for socket programming thanks

    K P 2 Replies Last reply
    0
    • P p_

      hi all i want to know that how can i know the system port number as i need it for socket programming thanks

      K Offline
      K Offline
      kakan
      wrote on last edited by
      #2

      p_ wrote:

      the system port number

      :confused::confused::confused: If you want to know the standard ports (aka "well known ports"), you can find a list here[^]

      Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson

      1 Reply Last reply
      0
      • P p_

        hi all i want to know that how can i know the system port number as i need it for socket programming thanks

        P Offline
        P Offline
        p_
        wrote on last edited by
        #3

        thanks for ur answer sir i use this code on a button but port which is in bold does not work so please tell me what port number i should use CAsyncSocket m_sListener, m_sConnected; UpdateData(TRUE); m_sListener.Create(port); if(m_sListener.Listen()==FALSE) { AfxMessageBox("Unable to Listen on that port,please try another port"); m_sListener.Close(); return; } m_sConnected.Create(); m_sConnected.Connect("10.179.22.75",port); if( m_sListener.Listen()== FALSE) { AfxMessageBox("Unable to Listen ,please try another port"); m_sListener.Close(); return; } thanks

        D D 2 Replies Last reply
        0
        • P p_

          thanks for ur answer sir i use this code on a button but port which is in bold does not work so please tell me what port number i should use CAsyncSocket m_sListener, m_sConnected; UpdateData(TRUE); m_sListener.Create(port); if(m_sListener.Listen()==FALSE) { AfxMessageBox("Unable to Listen on that port,please try another port"); m_sListener.Close(); return; } m_sConnected.Create(); m_sConnected.Connect("10.179.22.75",port); if( m_sListener.Listen()== FALSE) { AfxMessageBox("Unable to Listen ,please try another port"); m_sListener.Close(); return; } thanks

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          p_ wrote:

          ...port which is in bold does not work...

          Which is all but totally meaningless.


          "A good athlete is the result of a good and worthy opponent." - David Crow

          "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

          1 Reply Last reply
          0
          • P p_

            thanks for ur answer sir i use this code on a button but port which is in bold does not work so please tell me what port number i should use CAsyncSocket m_sListener, m_sConnected; UpdateData(TRUE); m_sListener.Create(port); if(m_sListener.Listen()==FALSE) { AfxMessageBox("Unable to Listen on that port,please try another port"); m_sListener.Close(); return; } m_sConnected.Create(); m_sConnected.Connect("10.179.22.75",port); if( m_sListener.Listen()== FALSE) { AfxMessageBox("Unable to Listen ,please try another port"); m_sListener.Close(); return; } thanks

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

            Guy, if you don't know the port number of the service you're trying to connect to on the server, we're not going to be able to tell you. After all, you haven't said anything about this service so we don't know what it is you're trying to connect to!

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                 2006, 2007

            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