> For the complete documentation index, see [llms.txt](https://developer.1moneynetwork.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.1moneynetwork.com/integrations/websocket/keeping-the-connection-alive.md).

# Keeping the connection alive

To keep the connection alive, a <mark style="color:red;">`Ping`</mark> frame will be sent from the server every 20s, and a <mark style="color:red;">`Pong`</mark> is expected to be received from the client. If a `Pong` is not received within 60s, a <mark style="color:red;">`Close`</mark> frame will be sent and the connection will be closed.

If the server is shutting down, a <mark style="color:red;">`Close`</mark> frame will be sent and then a grace period of 20s will be given before the connection is closed. The client should reconnect after receiving the <mark style="color:red;">`Close`</mark> frame. The client will be reconnected to a server that is not shutting down.

{% hint style="success" %}
You will reveice below stream data every 60s:

`< Received ping (data: "hi")`
{% endhint %}
