Contents

closeCode

A code that indicates the reason a connection closed.

Declaration

var closeCode: URLSessionWebSocketTask.CloseCode { get }

Discussion

You can retrieve the close code at any time. When the task is not yet closed, this value is URLSessionWebSocketTask.CloseCode.invalid.

See Also

Closing the connection