Unsolved QNetworkAccessManager and VPN
-
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? -
Is the application restarted after you have disconnected from VPN and done a standard internet connection?
-
No, I don't want my application restart because of the network state change.
-
Hi,
Is that server accessible outside of the VPN ?
If so, is it using the exact same address ? -
Gut feeling is that you have to use a new QNetworkAccessManager.
-
@SGaist Yes, the server is accessible from both network conditions.
It is a very simple Http server with a valid public IP. -
@koahnig I think the QNetworkAccessManager has roaming capability that can adapt connection based on network conditions.
-
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 ? -
@SGaist Windows 7 and Qt 5.12.3
-
You should also test with a more recent version of Qt.
By the way, how exactly are you switching from VPN to normal connection ?
-
@SGaist Through a TAP Windows Adapter V9.
-
Can you explain that with more details.
-
This post is deleted!