URLSessionWebSocketTask class

A task associated with a WebSocket connection.

See NSURLSessionWebSocketTask

Inheritance

Properties

closeCode int
The close code set when the WebSocket connection is closed.
no setter
closeReason Data?
The close reason set when the WebSocket connection is closed. If there is no close reason available this property will be null.
no setter
countOfBytesExpectedToReceive int
The number of content bytes that are expected to be received from the server.
no setterinherited
countOfBytesExpectedToSend int
The number of content bytes that the task expects to send to the server.
no setterinherited
countOfBytesReceived int
The number of content bytes that have been received from the server.
no setterinherited
countOfBytesSent int
Whether the body of the response should be delivered incrementally or not.
no setterinherited
currentRequest URLRequest?
The request currently being handled by the task.
no setterinherited
error Error?
An error indicating why the task failed or null on success.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
originalRequest URLRequest?
The original request associated with the task.
no setterinherited
prefersIncrementalDelivery bool
Whether the body of the response should be delivered incrementally or not.
getter/setter pairinherited
priority double
The relative priority 0, 1 that the host should use to handle the request.
getter/setter pairinherited
response URLResponse?
The server response to the request associated with this task.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
state URLSessionTaskState
The current state of the task.
no setterinherited
taskDescription String
The user-assigned description for the task.
getter/setter pairinherited
taskIdentifier int
A unique ID for the URLSessionTask in a URLSession.
no setterinherited

Methods

cancel() → void
Cancels the task.
inherited
cancelWithCloseCode(int closeCode, Data? reason) → void
Sends close frame with the given code and optional reason.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
receiveMessage() Future<URLSessionWebSocketMessage>
Receives a single WebSocket message.
resume() → void
Resumes a suspended task (new tasks start as suspended).
inherited
sendMessage(URLSessionWebSocketMessage message) Future<void>
Sends a single WebSocket message.
suspend() → void
Suspends a task (prevents it from transferring data).
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited