cancel() Cancels the connection and gracefully disconnects any established network protocols. Declarationfinal func cancel() See AlsoCanceling ConnectionsforceCancel()cancelCurrentEndpoint()