DarwinWebSocketClient

class DarwinWebSocketClient(sessionConfig: NSURLSessionConfiguration = NSURLSessionConfiguration.defaultSessionConfiguration(), maximumMessageSize: Long? = null) : WebSocketClient

An implementation of WebSocketClient using darwin's native NSURLSessionWebSocketTask. This is only available is iOS 13.0+, tvOS 13.0+, watchOS 6.0+, macOS 10.15+ (see documentation)

A custom sessionConfig can be passed to customize the behavior of the connection. Also, if a non-null maximumMessageSize if provided, it will be used to configure the web socket.

Constructors

Link copied to clipboard
constructor(sessionConfig: NSURLSessionConfiguration = NSURLSessionConfiguration.defaultSessionConfiguration(), maximumMessageSize: Long? = null)

Properties

Link copied to clipboard
open override val supportsCustomHeaders: Boolean = true

Functions

Link copied to clipboard
open suspend override fun connect(url: String, protocols: List<String>, headers: Map<String, String>): WebSocketConnection