Function SCNetworkConnectionCopyStatistics

Source
pub unsafe extern "C-unwind" fn SCNetworkConnectionCopyStatistics(
    connection: &SCNetworkConnection,
) -> Option<CFRetained<CFDictionary>>
Available on crate feature SCNetworkConnection only.
Expand description

Returns the statistics of the SCNetworkConnection. A statistic dictionary contains specific dictionaries with statistics for each subcomponent of the service.

For example, a statistics dictionary will contain the following sub-dictionaries, keys, and values:


```text
 
    PPP : BytesIn    :
    PPP : BytesOut   : Contains the number of bytes going up into
               (or coming out of) the network stack for
               any networking protocol without the PPP
               headers and trailers.
 
    PPP : PacketsIn  :
    PPP : PacketsOut : Contains the number of packets going up into
               (or coming out of) the network stack for
               any networking protocol without the PPP
               headers and trailers.
 
    PPP : ErrorsIn   :
    PPP : ErrorsOut  : Contains the number of errors going up into
               (or coming out of) the network stack for
               any networking protocol without the PPP
               headers and trailers.
```

The statistics dictionary may be extended in the future to contain additional information.

Parameter connection: The SCNetworkConnection to obtained statistics from.

Returns: Returns the statistics dictionary. If NULL is returned, the error can be retrieved using the SCError function.