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. [Message Deleted]

[Message Deleted]

Scheduled Pinned Locked Moved C / C++ / MFC
7 Posts 2 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.
  • G Offline
    G Offline
    Gajendra Sharma
    wrote on last edited by
    #1

    [Message Deleted]

    CPalliniC 1 Reply Last reply
    0
    • G Gajendra Sharma

      [Message Deleted]

      CPalliniC Offline
      CPalliniC Offline
      CPallini
      wrote on last edited by
      #2

      I guess gethostbyname("localhost") may help. :)

      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
      This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
      [My articles]

      In testa che avete, signor di Ceprano?

      G 1 Reply Last reply
      0
      • CPalliniC CPallini

        I guess gethostbyname("localhost") may help. :)

        If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
        This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
        [My articles]

        G Offline
        G Offline
        Gajendra Sharma
        wrote on last edited by
        #3

        Thanks for your reply. I do not want to resolve the loopback address through naming services such as /etc/hosts file. I need to get the real loopback address configured with the machine irrespective of whether it is specified in /etc/hosts file or not. gethostbyname() will give me what is configured in /etc/hosts file. Is there any other mechanism to get the real loopback address of the machine e.g. reading the routing table etc.? Thanks and Best regards. Gajendra Sharma

        Gajendra

        CPalliniC 1 Reply Last reply
        0
        • G Gajendra Sharma

          Thanks for your reply. I do not want to resolve the loopback address through naming services such as /etc/hosts file. I need to get the real loopback address configured with the machine irrespective of whether it is specified in /etc/hosts file or not. gethostbyname() will give me what is configured in /etc/hosts file. Is there any other mechanism to get the real loopback address of the machine e.g. reading the routing table etc.? Thanks and Best regards. Gajendra Sharma

          Gajendra

          CPalliniC Offline
          CPalliniC Offline
          CPallini
          wrote on last edited by
          #4

          Gajendra Sharma wrote:

          I do not want to resolve the loopback address through naming services such as /etc/hosts file.

          Isn't it by definition [^], the loopback? :)

          If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
          This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
          [My articles]

          In testa che avete, signor di Ceprano?

          G 1 Reply Last reply
          0
          • CPalliniC CPallini

            Gajendra Sharma wrote:

            I do not want to resolve the loopback address through naming services such as /etc/hosts file.

            Isn't it by definition [^], the loopback? :)

            If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
            This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
            [My articles]

            G Offline
            G Offline
            Gajendra Sharma
            wrote on last edited by
            #5

            loopback address can exist even if /etc/hosts file dosn't have an entry indicating it. Am i missing something?

            Gajendra

            CPalliniC 1 Reply Last reply
            0
            • G Gajendra Sharma

              loopback address can exist even if /etc/hosts file dosn't have an entry indicating it. Am i missing something?

              Gajendra

              CPalliniC Offline
              CPalliniC Offline
              CPallini
              wrote on last edited by
              #6

              Gajendra Sharma wrote:

              loopback address can exist even if /etc/hosts file dosn't have an entry indicating it.

              That's is true, I suppose, anyway it is not a point against my argument: since loopback is by definition the address resolved by name services, I guess that gethostbyname (or getaddrinfo [^]) will do the job. :)

              If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
              This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
              [My articles]

              In testa che avete, signor di Ceprano?

              G 1 Reply Last reply
              0
              • CPalliniC CPallini

                Gajendra Sharma wrote:

                loopback address can exist even if /etc/hosts file dosn't have an entry indicating it.

                That's is true, I suppose, anyway it is not a point against my argument: since loopback is by definition the address resolved by name services, I guess that gethostbyname (or getaddrinfo [^]) will do the job. :)

                If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                [My articles]

                G Offline
                G Offline
                Gajendra Sharma
                wrote on last edited by
                #7

                Thanks for your help. I could solve the problem by enumerating local interfaces using WSAIoctl and then checking loopback net with flag IFF_LOOPBACK.

                Gajendra

                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