A report that provides metrics about how a connection was established.


struct NWConnection.EstablishmentReport


Inspecting Connection Attempts

let duration: TimeInterval

The total duration of the successful connection establishment attempt, from the preparing state to the ready state.

let previousAttemptCount: Int

The number of attempts made before the successful attempt, when the connection moved from the preparing state back to the waiting state.

let attemptStartedAfterInterval: TimeInterval

The time between the call to start and the beginning of the successful connection attempt.

var debugDescription: String

The description of the report.

Inspecting Resolution

let resolutions: [NWConnection.EstablishmentReport.Resolution]

The array of resolution steps performed during connection establishment, in order from first resolved to last resolved.

struct NWConnection.EstablishmentReport.Resolution

A description of a single DNS resolution step.

Inspecting Protocol Handshakes

let handshakes: [NWConnection.EstablishmentReport.Handshake]

The array of protocol handshakes in order from first completed to last completed.

struct NWConnection.EstablishmentReport.Handshake

A description of a single protocol handshake.

Checking for Proxies

let proxyConfigured: Bool

A Boolean indicating whether a proxy was configured on the connection.

let usedProxy: Bool

A Boolean indicating whether the connection used a proxy.

let proxyEndpoint: NWEndpoint?

The endpoint of the proxy the connection used.


See Also

Collecting Connection Metrics

Collecting Network Connection Metrics

Use reports to understand how DNS and protocol handshakes impact connection establishment.

func requestEstablishmentReport(queue: DispatchQueue, completion: (NWConnection.EstablishmentReport?) -> Void)

Requests a copy of the connection's establishment report once the connection is in the ready state.

func startDataTransferReport() -> NWConnection.PendingDataTransferReport

Begins a new data transfer report, which can later be collected.

class NWConnection.PendingDataTransferReport

An outstanding data transfer report that has yet to be collected.

struct NWConnection.DataTransferReport

A report that provides metrics about data being sent and received on a connection.