Super class: NSURLSessionTaskMBS
|class||Cocoa Networking||MBS MacFrameworks Plugin||20.2||✅ Yes||❌ No||❌ No||✅ Yes||All|
A client can also provide a list of protocols it wishes to advertise during the WebSocket handshake phase.
Once the handshake is successfully completed the client will be notified through an optional delegate.
All reads and writes enqueued before the completion of the handshake will be queued up and executed once the hanshake succeeds. Before the handshake completes, the client can be called to handle redirection or authentication using the same delegates as NSURLSessionTask. WebSocket task will also provide support for cookies and will store cookies to the cookie storage on the session and will attach cookies to outgoing HTTP handshake requests.
Available on MacOS 10.15 or newer.
Subclass of the NSURLSessionTaskMBS class.
This is an abstract class. You can't create an instance, but you can get one from various plugin functions.
- 3 properties
- 5 methods
- method cancel(closeCode as Integer, reason as MemoryBlock)
- method Constructor
- method receiveMessage(Handler as NSURLSessionWebSocketTaskReceiveMessageCompletedMBS, tag as variant = nil)
- method sendMessage(message as NSURLSessionWebSocketMessageMBS, Handler as NSURLSessionWebSocketTaskSendMessageCompletedMBS, tag as variant = nil)
- method sendPing(Handler as NSURLSessionWebSocketTaskSendPingWithPongReceivedMBS, tag as variant = nil)
- 3 delegates
- delegate NSURLSessionWebSocketTaskReceiveMessageCompletedMBS(webSocketTask as NSURLSessionWebSocketTaskMBS, message as NSURLSessionWebSocketMessageMBS, error as NSErrorMBS, tag as variant)
- delegate NSURLSessionWebSocketTaskSendMessageCompletedMBS(webSocketTask as NSURLSessionWebSocketTaskMBS, error as NSErrorMBS, tag as variant)
- delegate NSURLSessionWebSocketTaskSendPingWithPongReceivedMBS(webSocketTask as NSURLSessionWebSocketTaskMBS, error as NSErrorMBS, tag as variant)
- 13 constants
Internal Server Error
Invalid Frame Payload Data
Mandatory Extension Missing
Message Too Big
No Status Received
TLS Handshake Failure
Super class NSURLSessionTaskMBS
- 17 properties
- property countOfBytesClientExpectsToReceive as Int64
- property countOfBytesClientExpectsToSend as Int64
- property countOfBytesExpectedToReceive as Int64
- property countOfBytesExpectedToSend as Int64
- property countOfBytesReceived as Int64
- property countOfBytesSent as Int64
- property currentRequest as NSURLRequestMBS
- property earliestBeginDate as Date
- property earliestBeginDateTime as DateTime
- property error as NSErrorMBS
- property Handle as Integer
- property originalRequest as NSURLRequestMBS
- property Priority as Single
- property response as NSURLResponseMBS
- property state as Integer
- property taskDescription as String
- property taskIdentifier as UInt64
- 5 methods
- 4 shared methods
- 4 constants
The task has received a cancel message.
The delegate may or may not have received a taskDidCompleteWithError message yet. A task in this state is not subject to timeouts.
The task has completed (without being canceled), and the task's delegate receives no further callbacks.
If the task completed successfully, the task’s error property is nil. Otherwise, it provides an error object that tells what went wrong. A task in this state is not subject to timeouts.
The task is currently being serviced by the session.
A task in this state is subject to the request and resource timeouts specified in the session configuration object.
The task was suspended by the app.
No further processing takes place until the task is resumed. A task in this state is not subject to timeouts.
This class has no sub classes.
Some methods using this class:
- NSURLSessionMBS.webSocketTaskWithRequest(request as NSURLRequestMBS) as NSURLSessionWebSocketTaskMBS
- NSURLSessionMBS.webSocketTaskWithURL(URL as String) as NSURLSessionWebSocketTaskMBS
- NSURLSessionMBS.webSocketTaskWithURL(URL as String, Protocols() as String) as NSURLSessionWebSocketTaskMBS
Some events using this class:
- NSURLSessionMBS.webSocketTaskDidCloseWithCode(webSocketTask as NSURLSessionWebSocketTaskMBS, closeCode as Integer, reason as MemoryBlock)
- NSURLSessionMBS.webSocketTaskDidOpenWithProtocol(webSocketTask as NSURLSessionWebSocketTaskMBS, protocol as String)
The items on this page are in the following plugins: MBS MacFrameworks Plugin.
MBS Xojo Plugins