NEPacketTunnelProvider calculate total traffic without packetFlow

Hi.

i've got a case, when i've successfully run Packet - Tunnel with NEPacketTunnelProvider (socks protocol)

And i can't found a way to calculate traffic.

i've tried with usage

self.packetFlow.readPackets...  

self.packetFlow.writePackets... 

with different ways, but each time when i call methods, which contains lines with packet flow, nothing happens, i think its related to my protocol and library which i've use to implement packet tunneling, cause its freeze the thread. By the way its working great in memory limits of iOS.

i've see that the profiler in xcode is showing spended traffic.

I've also trying to get with functions

getifaddrs

name of virtual interface which extension is create for use, and by the name, found virtual adapter, but all fields of objects there, which i found, doesn't provide any helpful information related to size of packages information

Also i've tried to implement custom NEPacketTunnelFlow, and use them in NEPacketTunnelProvider, but as the result NEPacketTunnelProvider not starting, and crashing without any helpfull information.

Can someone give some prompts where i can found some ways of solution?

NEPacketTunnelProvider calculate total traffic without packetFlow
 
 
Q