private void WebsocketClient_OnClosed(int arg1, string arg2, string arg3)
        {
            PrintLog(string.Format("websocket closed with code is {0},reason is {1} and detail is {2}", arg1, arg2, arg3));
            var args = new AVIMDisconnectEventArgs(arg1, arg2, arg3);

            m_OnDisconnected?.Invoke(this, args);
        }
        private void WebsocketClient_OnClosed(int errorCode, string reason, string detail)
        {
            PrintLog(string.Format("websocket closed with code is {0},reason is {1} and detail is {2}", errorCode, reason, detail));
            state = Status.Offline;

            var disconnectEventArgs = new AVIMDisconnectEventArgs(errorCode, reason, detail);

            m_OnDisconnected?.Invoke(this, disconnectEventArgs);

            this.WebSocketState = new WebSocketStateOptions()
            {
                ClosedCode = errorCode
            };
        }
        private void WebsocketClient_OnClosed(int arg1, string arg2, string arg3)
        {
            if (State != Status.Closed)
            {
                state = Status.Offline;
                PrintLog(string.Format("websocket closed with code is {0},reason is {1} and detail is {2}", arg1, arg2, arg3));
                var args = new AVIMDisconnectEventArgs(arg1, arg2, arg3);
                m_OnDisconnected?.Invoke(this, args);

                // 如果断线产生的原因是客户端掉线而不是服务端踢下线,则应该开始自动重连
                if (arg1 == 0)
                {
                    StartAutoReconnect();
                }
            }
        }