Unified in-app VPN SDK's for Microsoft Windows Vista+, Android 4.4+ and Mac OS 10.7+. Earlier OS versions can be supported as well by request. Please contact [email protected] to receive your own API key.

Copyright © 2019 VPNWholesaler.com. All rights reserved.

Back

3.22 StopVPNConn OS X Example

StopVPNConnection() function could be written in the following way:

void StopVPNConnection()
{
    json_object *j_obj;
    char szCmd[1024];
    j_obj = json_object_new_object();
    json_object_object_add(j_obj, "cmd", json_object_new_int(OVS_CMD_DISCONNECT));
    snprintf(szCmd, sizeof(szCmd), "%s", json_object_get_string(j_obj));
    json_object_put(j_obj);
    CmdProc(szCmd); 
}

This method doesn't invoke any callback.

Only when VPN state is changed callback is invoked with one of the following codes:

  1. OVS_NOTIFY_VPN_CONNECTING
  2. OVS_NOTIFY_VPN_CONNECTED
  3. OVS_NOTIFY_VPN_DISCONNECTED
  4. OVS_NOTIFY_VPN_CONNECT_FAILED
  5. OVS_NOTIFY_VPN_ABNOMARLY_DISCONNECTED