@objcMembers
@objc
open class PusherConnection : NSObject
extension PusherConnection: WebSocketConnectionDelegate
Undocumented
Undocumented
DeclarationSwift
public let url: String
Undocumented
DeclarationSwift
public let key: String
Undocumented
DeclarationSwift
open var socketId: String?
Undocumented
DeclarationSwift
open var socket: NWWebSocket!
Undocumented
DeclarationSwift
open var URLSession: Foundation.URLSession
Undocumented
DeclarationSwift
open var reconnectAttemptsMax: Int?
Undocumented
DeclarationSwift
open var reconnectAttempts: Int
Undocumented
DeclarationSwift
open var maxReconnectGapInSeconds: Double?
Undocumented
DeclarationSwift
open var pongResponseTimeoutInterval: TimeInterval
Undocumented
DeclarationSwift
open var activityTimeoutInterval: TimeInterval
Initializes a new PusherConnection with an app key, websocket, URL, options and URLSession
Parameters key
The Pusher app key
socket
The websocket object
url
The URL the connection is made to
options
A PusherClientOptions instance containing all of the user-specified client options
URLSession
An NSURLSession instance for the connection to use for making authentication requests
Return ValueA new PusherConnection instance
Either writes a string directly to the websocket with the given event name and data, or calls a client event to be sent if the event is prefixed with “client”
DeclarationSwift
open func sendEvent(event: String, data: Any, channel: PusherChannel? = nil)
Parameters event
The name of the event
data
The data to be stringified and sent
channel
The name of the channel
Disconnects the websocket
DeclarationSwift
open func disconnect()
Establish a websocket connection
DeclarationSwift
open func connect()
Handles incoming error
Parameters error
The incoming error to be processed
Handles incoming events and passes them on to be handled by the appropriate function
Parameters event
The incoming event to be processed
Delegate method called when a message is received over a websocket
DeclarationSwift
public func webSocketDidReceiveMessage(connection: WebSocketConnection, string: String)
Parameters connection
The websocket that has received the message
string
The message received over the websocket
Delegate method called when a pong is received over a websocket
DeclarationSwift
public func webSocketDidReceivePong(connection: WebSocketConnection)
Parameters connection
The websocket that has received the pong
Delegate method called when a websocket disconnected
DeclarationSwift
public func webSocketDidDisconnect(connection: WebSocketConnection,
closeCode: NWProtocolWebSocket.CloseCode,
reason: Data?)
Parameters connection
The websocket that disconnected
closeCode
The closure code for the websocket connection.
reason
Optional further information on the connection closure.
Swift
public func webSocketViabilityDidChange(connection: WebSocketConnection, isViable: Bool)
Swift
public func webSocketDidAttemptBetterPathMigration(result: Result<WebSocketConnection, NWError>)
Delegate method called when a websocket connected
DeclarationSwift
public func webSocketDidConnect(connection: WebSocketConnection)
Parameters connection
The websocket that connected
Swift
public func webSocketDidReceiveMessage(connection: WebSocketConnection, data: Data)
Swift
public func webSocketDidReceiveError(connection: WebSocketConnection, error: NWError)
Undocumented
DeclarationSwift
var OCReconnectAttemptsMax: NSNumber? { get set }
Undocumented
DeclarationSwift
var OCMaxReconnectGapInSeconds: NSNumber? { get set }
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4