The client API provides us with following built in events:
- connectWhen the client successfully connects.
- connectingWhen the client is in process of connecting.
- disconnectWhen the client is disconnected
- connect_failedWhen connection to server fails
- errorAn error event is sent from the server
- messageWhen server sends a message using the send function.
- reconnectWhen reconnection to server is successful.
- reconnectingWhen the client is in process of connecting.
- reconnect_failedWhen the reconnection attempt fails.
socket.on('connect_failed', function() { document.write("Sorry, there seems to be an issue with the connection!"); })
No comments:
Post a Comment