SocketClientEvent
public enum SocketClientEvent : String
The set of events that are generated by the client.
-
Emitted when the client connects. This is also called on a successful reconnection. A connect event gets one data item: the namespace that was connected to.
socket.on(clientEvent: .connect) {data, ack in guard let nsp = data[0] as? String else { return } // Some logic using the nsp }
Declaration
Swift
case connect
-
Called when the socket has disconnected and will not attempt to try to reconnect.
Declaration
Swift
case disconnect
-
Called when an error occurs.
Declaration
Swift
case error
-
Called when the client begins the reconnection process.
Declaration
Swift
case reconnect
-
Called each time the client tries to reconnect to the server.
Declaration
Swift
case reconnectAttempt
-
Called every time there is a change in the client’s status.
Declaration
Swift
case statusChange