WebSocket
open class WebSocket : WebSocketClient, WebSocketEngineDelegate
WebSocket客户端
-
Undocumented
Declaration
Swift
public weak var delegate: WebSocketDelegate?
-
Undocumented
Declaration
Swift
public var onEvent: ((WebSocketEvent) -> Void)?
-
Undocumented
Declaration
Swift
public var request: URLRequest
-
Undocumented
Declaration
Swift
public var callbackQueue: DispatchQueue
-
Undocumented
Declaration
Swift
public var respondToPingWithPong: Bool { get set }
-
Undocumented
Declaration
Swift
public init(request: URLRequest, engine: WebSocketEngineProtocol)
-
Undocumented
Declaration
Swift
public convenience init(request: URLRequest, certPinner: WebSocketCertificatePinning? = WebSocketFoundationSecurity(), compressionHandler: WebSocketCompressionHandler? = nil, useCustomEngine: Bool = true)
-
Undocumented
Declaration
Swift
public func connect()
-
Undocumented
Declaration
Swift
public func disconnect(closeCode: UInt16 = WebSocketCloseCode.normal.rawValue)
-
Undocumented
Declaration
Swift
public func forceDisconnect()
-
Undocumented
Declaration
Swift
public func write(data: Data, completion: (() -> ())?)
-
Undocumented
Declaration
Swift
public func write(string: String, completion: (() -> ())?)
-
Undocumented
Declaration
Swift
public func write(stringData: Data, completion: (() -> ())?)
-
Undocumented
Declaration
Swift
public func write(ping: Data, completion: (() -> ())?)
-
Undocumented
Declaration
Swift
public func write(pong: Data, completion: (() -> ())?)
-
Undocumented
Declaration
Swift
public func didReceive(event: WebSocketEvent)