How to get Throughput in VPN session?

Hi,

I am working on a vpn application, there is a problem need your hepl.

My app using Shadowsock protocol.

In NEVPNConnection have only NEVPNStatus and connectedDate


/**

* @property status

* @discussion The current status of the VPN.

*/

@available(iOS 8.0, *)

open var status: NEVPNStatus { get }


/**

* @property connectedDate

* @discussion The date and time when the connection status changed to NEVPNStatusConnected. This property is nil if the connection is not fully established.

*/

@available(iOS 9.0, *)

open var connectedDate: Date? { get }



So, how to get the total data in a session after the end of the session.

Thank for support.

Replies

Are you using a built-in VPN transport? Or implementing your own VPN transport via a NetworkExtension provider app extension? [Based on your other thread it’s clear you’re doing the latter.]

If you’re implementing your own provider, you can track throughput statistics inside your provider and then vend it to your container app via the provider/app message API (

-sendProviderMessage:returnError:responseHandler:
on the app side,
-handleAppMessage:completionHandler:
on the provider side).

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"