Beispiel #1
0
        private void HandleReconnectFailure()
        {
            if (dispose)
            {
                return;
            }

            if ((DateTime.UtcNow - lastReconnectFailure).TotalSeconds < reconnectWait * 2)
            {
                reconnectWait += 10;

                reconnectWait = Math.Min(reconnectWait, 100);
            }
            else
            {
                reconnectWait = 10;
            }

            lastReconnectFailure = DateTime.UtcNow;

            Thread.Sleep(reconnectWait * 1000);

            FKeyAccessor.ClearCache();
            Auth.InvalidateHostCache(Host);

            WebSocket = GetWebSocket();

            EventRouter.SetWebSocket(WebSocket);
        }
Beispiel #2
0
        private void Initialise(string host, int roomId)
        {
            Host   = host.GetChatHost();
            RoomId = roomId;

            WebSocket   = GetWebSocket();
            EventRouter = new EventRouter(roomId, WebSocket);
        }
Beispiel #3
0
        public void Dispose()
        {
            if (dispose)
            {
                return;
            }
            dispose = true;

            EventRouter?.Dispose();
            WebSocket?.Dispose();

            GC.SuppressFinalize(this);
        }