What reasons are there for Binance to close a websocket connection?

I’m connecting to a websocket (Spot) and receiving market data. I am not sending orders. Every 5 minutes I send a ping, to keep the connection alive.

Sometimes when I try to send a ping, the socket has been closed and I get a broken pipe error.

What reasons are there for Binance to close the connection?

How long the connection got closed since it’s connected?