Skip to content

CocoaMQTTWebSocket_FoundationConnection

leeway edited this page Nov 19, 2021 · 1 revision

CocoaMQTTWebSocket.FoundationConnection

class FoundationConnection: NSObject, CocoaMQTTWebSocketConnection 

Inheritance

CocoaMQTTWebSocketConnection, NSObject, URLSessionWebSocketDelegate

Initializers

init(url:config:)

public init(url: URL, config: URLSessionConfiguration) 

Properties

delegate

public weak var delegate: CocoaMQTTWebSocketConnectionDelegate?

queue

public lazy var queue 

session

var session: URLSession?

task

var task: URLSessionWebSocketTask?

Methods

connect()

public func connect() 

disconnect()

public func disconnect() 

write(data:handler:)

public func write(data: Data, handler: @escaping (Error?) -> Void) 

scheduleRead()

func scheduleRead() 

urlSession(_:task:didReceive:completionHandler:)

public func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) 

urlSession(_:webSocketTask:didOpenWithProtocol:)

public func urlSession(_ session: URLSession, webSocketTask: URLSessionWebSocketTask, didOpenWithProtocol protocol: String?) 

urlSession(_:webSocketTask:didCloseWith:reason:)

public func urlSession(_ session: URLSession, webSocketTask: URLSessionWebSocketTask, didCloseWith closeCode: URLSessionWebSocketTask.CloseCode, reason: Data?) 
Types
Protocols
Global Variables
Clone this wiki locally