Skip to content

Commit

Permalink
[docs] Add a note about reconnecting after a server-side disconnection
Browse files Browse the repository at this point in the history
  • Loading branch information
darrachequesne committed Mar 29, 2018
1 parent 74893d5 commit afb952d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
});
```

Expand Down

0 comments on commit afb952d

Please sign in to comment.