Code Monkey home page Code Monkey logo

Comments (4)

lihengchang avatar lihengchang commented on August 16, 2024

When the VPN is closed, the openVPNAdapter:handleError: method returns an error :

Error Domain=me.ss-abramchuk.openvpn-adapter.error-domain Code=27 "OpenVPN error occured" UserInfo={NSLocalizedDescription=OpenVPN error occured, me.ss-abramchuk.openvpn-adapter.error-key.message=EADDRNOTAVAIL: Can't assign requested address, me.ss-abramchuk.openvpn-adapter.error-key.fatal=false, NSLocalizedFailureReason=General transport error}

from openvpnadapter.

lihengchang avatar lihengchang commented on August 16, 2024

In fact, when the VPN was closed, the openVPNAdapter:handleError: method called back twice

Error returned for the first time :

Error Domain=me.ss-abramchuk.openvpn-adapter.error-domain Code=27 "OpenVPN error occured" UserInfo={NSLocalizedDescription=OpenVPN error occured, me.ss-abramchuk.openvpn-adapter.error-key.message=EADDRNOTAVAIL: Can't assign requested address, me.ss-abramchuk.openvpn-adapter.error-key.fatal=false, NSLocalizedFailureReason=General transport error}

Error returned for the second time :

Error Domain=me.ss-abramchuk.openvpn-adapter.error-domain Code=20 "Failed to reset tunnel. Check underlying error for more details." UserInfo={me.ss-abramchuk.openvpn-adapter.error-key.fatal=true, NSLocalizedDescription=Failed to reset tunnel. Check underlying error for more details., NSUnderlyingError=0x10360a450 {Error Domain=NEAgentErrorDomain Code=1 "(null)"}}

from openvpnadapter.

lihengchang avatar lihengchang commented on August 16, 2024

When I connect to VPN (4G), I turn on Wi-Fi, and when I turn off Wi-Fi, there is no such problem

So there is a point of suspicion. The VPN connection is established during Wi-Fi, and the socket is established based on Wi-Fi. Turning off Wi-Fi at this time will cause the socket to fail.

The VPN connection is established in 4G, and the socket is established based on 4G. Switch to Wi-Fi at this time, 4G network still exists, but the priority is not as good as Wi-Fi, so the socket is active

But I can’t verify this conjecture

from openvpnadapter.

lihengchang avatar lihengchang commented on August 16, 2024

Issue resolved

The reason for VPN is closed has been found. Because the openVPNAdapter:handleError: method is implemented in accordance with the demo on the homepage, when an error is received, the following code is executed, resulting in VPN is closed

if (self.startHandler) {
    self.startHandler(error);
}else {
    [self cancelTunnelWithError:error];
}

After commenting the if, it will automatically reconnect after 5 seconds.

It is recommended that the demo code on the homepage add comments to some non-essential codes, for example:

if (self.startHandler) {
    self.startHandler(error);
}else {
    [self cancelTunnelWithError:error];
}

And

self.startHandler = nil;

from openvpnadapter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.