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. ReadDatagram gives wrong ip address and port

ReadDatagram gives wrong ip address and port

Scheduled Pinned Locked Moved General and Desktop
8 Posts 2 Posters 2.3k 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.
  • J Offline
    J Offline
    johnmerlino
    wrote on last edited by
    #1

    I have a gsm modem with the following ip address: 10.122.91.216.

    I use readDatagram of QUdpSocket because it's a udp socket:

    qint64 QUdpSocket::readDatagram ( char * data, qint64 maxSize, QHostAddress * address = 0, quint16 * port = 0 )

    The problem is it told me the ip address was 74.205.127.225 even though that is wrong. The actual ip address is 10.122.91.216. Any idea why it gives me the wrong ip address?

    1 Reply Last reply
    0
    • Q Offline
      Q Offline
      qxoz
      wrote on last edited by
      #2

      Hi johnmerlino. It gives you a actual IP for www. The ip address 10.122.xx.xx is a internal ip from gsm operator.
      If you need connect two devices which use one GSM operator you can use 10.122.xx.xx but for communicating across WWW you need to use 74.205.127.225.

      1 Reply Last reply
      0
      • J Offline
        J Offline
        johnmerlino
        wrote on last edited by
        #3

        what about through a vpn?

        1 Reply Last reply
        0
        • Q Offline
          Q Offline
          qxoz
          wrote on last edited by
          #4

          VPN from GSM opertor?

          1 Reply Last reply
          0
          • J Offline
            J Offline
            johnmerlino
            wrote on last edited by
            #5

            I use openvpn on fedora

            1 Reply Last reply
            0
            • Q Offline
              Q Offline
              qxoz
              wrote on last edited by
              #6

              Only in case if GSM operator gives you an internal VPN and you connected via GSM modem you can directly connect with 10.122.xx.xx address because your PC also will have internal 10.122.xx.xx ip. In other cases(as i know) you need use actual WWW address.

              1 Reply Last reply
              0
              • J Offline
                J Offline
                johnmerlino
                wrote on last edited by
                #7

                " if GSM operator gives you an internal VPN". I know that a gsm modem supports an apn setting. But I don't recall a vpn setting on the "at command set" of a gsm modem. Do you have an example?

                1 Reply Last reply
                0
                • Q Offline
                  Q Offline
                  qxoz
                  wrote on last edited by
                  #8

                  I don't know how GSM operators works in your country, but here where i live VPN ( i mean closed vpn inside operators network and not connected to www ) is a additional service, and you can't just turn it on. This service usualy used for telemetry.
                  But in your case, as i understand you have a server and modem sends to it some messages. Does it matter what exactly ip have modem? If you want answer, just send message to detected IP and modem will get it.

                  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