mirror of
https://github.com/deneraraujo/OpenVPNAdapter.git
synced 2024-10-07 01:32:08 +08:00
Pause vpn client
This commit is contained in:
parent
105810082f
commit
099309c498
@ -161,6 +161,14 @@ NS_SWIFT_NAME(provide(credentials:));
|
||||
*/
|
||||
- (void)connect;
|
||||
|
||||
/**
|
||||
Pause the client –- useful to avoid continuous reconnection attempts
|
||||
when network is down
|
||||
|
||||
@param pauseReason <#reason description#>
|
||||
*/
|
||||
- (void)pauseWithReason:(nullable NSString *)pauseReason;
|
||||
|
||||
/**
|
||||
Close connection with the VPN server
|
||||
*/
|
||||
|
@ -227,6 +227,11 @@ NSString * const OpenVPNAdapterErrorEventKey = @"me.ss-abramchuk.openvpn-adapter
|
||||
});
|
||||
}
|
||||
|
||||
- (void)pauseWithReason:(NSString *)pauseReason {
|
||||
std::string reason = pauseReason ? std::string([pauseReason UTF8String]) : "";
|
||||
self.vpnClient->pause(reason);
|
||||
}
|
||||
|
||||
- (void)disconnect {
|
||||
self.vpnClient->stop();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user