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); }
private void Initialise(string host, int roomId) { Host = host.GetChatHost(); RoomId = roomId; WebSocket = GetWebSocket(); EventRouter = new EventRouter(roomId, WebSocket); }
public void Dispose() { if (dispose) { return; } dispose = true; EventRouter?.Dispose(); WebSocket?.Dispose(); GC.SuppressFinalize(this); }