You may receive a close frame when the API server behind the websocket is being restarted, or told to close its client-facing connections for an operational or load-balancing reason. In this case, you should simply reconnect the websocket.