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. QNetworkAccessManager and VPN
Qt 6.11 is out! See what's new in the release blog

QNetworkAccessManager and VPN

Scheduled Pinned Locked Moved Unsolved General and Desktop
13 Posts 4 Posters 1.5k Views 3 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.
  • HojjatJafaryH Offline
    HojjatJafaryH Offline
    HojjatJafary
    wrote on last edited by
    #1

    Hi,
    In my application I send simple REST requests using QNetworkAccessManager.
    If I connected to the Internet through VPN in windows machine everything works great but when I disconnect from VPN and connect using regular internet connection the QNetworkAccessManager does not reconnect to the server and I get "Network access is disabled." error message.
    How should I fix this?

    K 1 Reply Last reply
    0
    • HojjatJafaryH HojjatJafary

      Hi,
      In my application I send simple REST requests using QNetworkAccessManager.
      If I connected to the Internet through VPN in windows machine everything works great but when I disconnect from VPN and connect using regular internet connection the QNetworkAccessManager does not reconnect to the server and I get "Network access is disabled." error message.
      How should I fix this?

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

      @HojjatJafary

      Is the application restarted after you have disconnected from VPN and done a standard internet connection?

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      0
      • HojjatJafaryH Offline
        HojjatJafaryH Offline
        HojjatJafary
        wrote on last edited by
        #3

        No, I don't want my application restart because of the network state change.

        K 1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi,

          Is that server accessible outside of the VPN ?
          If so, is it using the exact same address ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          HojjatJafaryH 1 Reply Last reply
          0
          • HojjatJafaryH HojjatJafary

            No, I don't want my application restart because of the network state change.

            K Offline
            K Offline
            koahnig
            wrote on last edited by
            #5

            @HojjatJafary

            Gut feeling is that you have to use a new QNetworkAccessManager.

            Vote the answer(s) that helped you to solve your issue(s)

            HojjatJafaryH 1 Reply Last reply
            0
            • SGaistS SGaist

              Hi,

              Is that server accessible outside of the VPN ?
              If so, is it using the exact same address ?

              HojjatJafaryH Offline
              HojjatJafaryH Offline
              HojjatJafary
              wrote on last edited by
              #6

              @SGaist Yes, the server is accessible from both network conditions.
              It is a very simple Http server with a valid public IP.

              1 Reply Last reply
              0
              • K koahnig

                @HojjatJafary

                Gut feeling is that you have to use a new QNetworkAccessManager.

                HojjatJafaryH Offline
                HojjatJafaryH Offline
                HojjatJafary
                wrote on last edited by HojjatJafary
                #7

                @koahnig I think the QNetworkAccessManager has roaming capability that can adapt connection based on network conditions.

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by SGaist
                  #8

                  Roaming and killing a connection is not exactly the same.

                  Creating a new QNAM is worth a try though.

                  By the way, what version of Qt are you using ?
                  On what OS ?

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  HojjatJafaryH 1 Reply Last reply
                  0
                  • SGaistS SGaist

                    Roaming and killing a connection is not exactly the same.

                    Creating a new QNAM is worth a try though.

                    By the way, what version of Qt are you using ?
                    On what OS ?

                    HojjatJafaryH Offline
                    HojjatJafaryH Offline
                    HojjatJafary
                    wrote on last edited by
                    #9

                    @SGaist Windows 7 and Qt 5.12.3

                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      You should also test with a more recent version of Qt.

                      By the way, how exactly are you switching from VPN to normal connection ?

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      HojjatJafaryH 1 Reply Last reply
                      0
                      • SGaistS SGaist

                        You should also test with a more recent version of Qt.

                        By the way, how exactly are you switching from VPN to normal connection ?

                        HojjatJafaryH Offline
                        HojjatJafaryH Offline
                        HojjatJafary
                        wrote on last edited by
                        #11

                        @SGaist Through a TAP Windows Adapter V9.

                        1 Reply Last reply
                        0
                        • SGaistS Offline
                          SGaistS Offline
                          SGaist
                          Lifetime Qt Champion
                          wrote on last edited by
                          #12

                          Can you explain that with more details.

                          Interested in AI ? www.idiap.ch
                          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                          B 1 Reply Last reply
                          0
                          • SGaistS SGaist

                            Can you explain that with more details.

                            B Offline
                            B Offline
                            braydenmayne
                            Banned
                            wrote on last edited by
                            #13
                            This post is deleted!
                            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