We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 1231351 + e3704a7 commit 5176283Copy full SHA for 5176283
docs/api/connection.md
@@ -229,3 +229,18 @@ The document **must** be of a [type]({{ site.baseurl }}{% link types/index.md %}
229
Return value
230
231
> A [`Presence`]({{ site.baseurl }}{% link api/presence.md %}) instance tied to the given document
232
+
233
+### ping()
234
235
+Send a short message to the server, which will respond with another short message, emitted on the connection as a
236
+`'pong'` event.
237
238
+```js
239
+connection.ping()
240
+connection.on('pong', () => {
241
+ // The server is still there
242
+})
243
+```
244
245
+{: .warn }
246
+Calling `ping()` when not connected will throw an error with code `ERR_CANNOT_PING_OFFLINE`.
0 commit comments