Instance Method

sendPing(pongReceiveHandler:)

Sends a ping frame from the client side, with a closure to receive the pong from the server endpoint.

Declaration

func sendPing(pongReceiveHandler: @escaping (Error?) -> Void)

Parameters

pongReceiveHandler

A closure called by the task when it receives the pong from the server. The closure receives an NSError that indicates a lost connection or other problem, or nil if no error occurred.

Discussion

When sending multiple pings, the task always calls pongReceiveHandler in the order it sent the pings.