public NotificationCenterWebSocketWriter(WebSocket webSocket, NotificationsBase notificationsBase, IMemoryContextPool contextPool, CancellationToken resourceShutdown) { _notificationsBase = notificationsBase; _contextPool = contextPool; _resourceShutdown = resourceShutdown; _webSocket = webSocket; }
public ClusterDashboardConnection(WebSocket webSocket, CanAccessDatabase canAccessDatabase, ClusterDashboardNotifications clusterDashboardNotifications, IMemoryContextPool contextPool, CancellationToken resourceShutdown) : base(webSocket, clusterDashboardNotifications, contextPool, resourceShutdown) { _canAccessDatabase = canAccessDatabase; _clusterDashboardNotifications = clusterDashboardNotifications; _returnReadContext = contextPool.AllocateOperationContext(out _readContext); }
public ProxyWebSocketConnection(WebSocket localWebSocket, string nodeUrl, string websocketEndpoint, IMemoryContextPool contextPool, CancellationToken token) { if (string.IsNullOrEmpty(nodeUrl)) { throw new ArgumentException("Node url cannot be null or empty", nameof(nodeUrl)); } if (string.IsNullOrEmpty(websocketEndpoint)) { throw new ArgumentException("Endpoint cannot be null or empty", nameof(websocketEndpoint)); } if (websocketEndpoint.StartsWith("/") == false) { throw new ArgumentException("Endpoint must starts with '/' character", nameof(websocketEndpoint)); } _localWebSocket = localWebSocket; _nodeUrl = nodeUrl; _contextPool = contextPool; _cts = CancellationTokenSource.CreateLinkedTokenSource(token); _remoteWebSocketUri = new Uri($"{nodeUrl.Replace("http", "ws", StringComparison.OrdinalIgnoreCase)}{websocketEndpoint}"); _remoteWebSocket = new ClientWebSocket(); }
public NotificationCenterWebSocketWriter(WebSocket webSocket, NotificationsBase notificationsBase, IMemoryContextPool contextPool, CancellationToken resourceShutdown) { _webSocket = webSocket; _notificationsBase = notificationsBase; contextPool.AllocateOperationContext(out _context); _resourceShutdown = resourceShutdown; }