Enumeration

URLSessionWebSocketTask.Message

An enumeration of the types of messages sent and received.

Declaration

enum Message

Topics

Message types

case data(Data)

A WebSocket message that contains a block of data.

case string(String)

A WebSocket message that contains a string.

See Also

Sending and Receiving Data

func send(URLSessionWebSocketTask.Message, completionHandler: (Error?) -> Void)

Sends a WebSocket message, receiving the result in a completion handler.

func receive(completionHandler: (Result<URLSessionWebSocketTask.Message, Error>) -> Void)

Reads a WebSocket message once all the frames of the message are available.

var maximumMessageSize: Int

The maximum number of bytes to buffer before the receive call fails with an error.