Instance Method

webSocketTaskWithURL:

Creates a WebSocket task for the provided URL.

Declaration

- (NSURLSessionWebSocketTask *)webSocketTaskWithURL:(NSURL *)url;

Parameters

url

The WebSocket URL with which to connect.

Discussion

The provided URL must have a ws or wss scheme.

See Also

Adding WebSocket Tasks to a Session

- webSocketTaskWithRequest:

Creates a WebSocket task for the provided URL request.

- webSocketTaskWithURL:protocols:

Creates a WebSocket task given a URL and an array of protocols.

NSURLSessionWebSocketTask

A URL session task that communicates over the WebSockets protocol standard.

NSURLSessionWebSocketDelegate

A protocol that defines methods that URL session instances call on their delegates to handle task-level events specific to WebSocket tasks.