diff --git a/docs/API.md b/docs/API.md index 5ebbcbce7..69cba5ae8 100644 --- a/docs/API.md +++ b/docs/API.md @@ -603,7 +603,11 @@ Fired upon a disconnection. ```js socket.on('disconnect', (reason) => { - // ... + if (reason === 'io server disconnect') { + // the disconnection was initiated by the server, you need to reconnect manually + socket.connect(); + } + // else the socket will automatically try to reconnect }); ```