Skip to content
This repository was archived by the owner on Apr 27, 2021. It is now read-only.

Commit 2df0b6a

Browse files
committed
Add "clientTimeout" topic to the documentation
1 parent b9b66d9 commit 2df0b6a

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

docs/WEBSOCKET-API.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ In the table bellow you can find the list of topics on which the `client` **must
9696
| Client Topic | Server Topic |
9797
|-------------------------------------------------------|---------------------------------------------------|
9898
| [invalidMessage](#invalidMessage) | none |
99+
| [clientTimeout](#clientTimeout) | none |
99100
| [requestRateLimitReached](#requestRateLimitReached) | none |
100101
| [ping](#ping) | [pong](#pong) |
101102
| [pongResponse](#pongResponse) | none |
@@ -700,6 +701,27 @@ Example using wscat:
700701

701702
---
702703

704+
#### clientTimeout
705+
If the server is not receiving any data from the client for more then 3 minutes, it will end the connection with the client.
706+
In this case it will send a message on this topic to let the client know the reason why it was diconnected.
707+
708+
This is not a message for which the server expects any response, so none should be sent back to the server!
709+
710+
```json
711+
{
712+
"topic": "clientTimeout",
713+
"payload": {
714+
"success": false,
715+
"data": [],
716+
"dataLength": 0,
717+
"warnings": ["No data received for more than 180 seconds, ending connection"],
718+
"errors": []
719+
}
720+
}
721+
```
722+
723+
---
724+
703725
#### requestRateLimitReached
704726
When a client is sending messages to the server with a high rate, it will throttle the requests from it send a warning message _"WebSocket request rate limit reached"_.
705727
The client should listen for this messages on this topic to know when it happens.

0 commit comments

Comments
 (0)