Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt Networking - TCP server ip address
Qt 6.11 is out! See what's new in the release blog

Qt Networking - TCP server ip address

Scheduled Pinned Locked Moved General and Desktop
6 Posts 3 Posters 6.4k 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.
  • M Offline
    M Offline
    Mathai
    wrote on last edited by
    #1

    Hi all,

    I am trying to write a network game. I am a newbie in networking. I know only the basics of TCP and UDP.
    To get started, I looked at the "forture server example":http://doc.qt.nokia.com/4.7-snapshot/network-fortuneserver.html

    I ran the example yesterday and got the ip address that looked something like 65.31.33.234 . I understand this is my public ip address. Everything looked fine until I ran it today. It now gives me my local ip address 192.168.2.4 . I wonder what changed between yesterday and today.

    Why did I get the external ip address yesterday and a local ip address today?
    I did not make any change in the code. Just to be sure, I rebuild the project again with code copied from the example.
    I am totally baffled!

    I am running Ubuntu 11.10.

    1 Reply Last reply
    0
    • V Offline
      V Offline
      VanDerSam
      wrote on last edited by
      #2

      What kind of connection to Internet do you use?

      1 Reply Last reply
      0
      • M Offline
        M Offline
        Mathai
        wrote on last edited by
        #3

        I use a wireless router. I am not sure if that's what you meant.

        1 Reply Last reply
        0
        • ? Offline
          ? Offline
          A Former User
          wrote on last edited by
          #4

          65.31.33.234 is a public routable IP address and is likely what your home network appears as when viewed from the Internet.

          192.168.2.4 is a private non-routable IP address and part of a class C network. This is most likely your IP address on your internal network as assigned by your router's DHCP service.

          Without more context it is impossible to say what has changed between.

          1 Reply Last reply
          0
          • M Offline
            M Offline
            Mathai
            wrote on last edited by
            #5

            Thanks ZapB. I think I have to use an external service to get my public routable IP address. I guess, for now, I can go ahead with the private non-routable IP address. It will let me network between computers in my home network (correct me if i am wrong)

            1 Reply Last reply
            0
            • ? Offline
              ? Offline
              A Former User
              wrote on last edited by
              #6

              Yes that is correct, you can just use the 192.168.2.x ip addresses to communicate internally on your local network. Good luck with your project!

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved