Exemplo n.º 1
0
        internal void OnOpen(WebSocket webSocket)
        {
            addMessage(() =>
            {
                lock (_L_registered)
                {
                    if (!_registeredSockets.Add(webSocket))
                        return;
                }

                RegisteredSocketsChange?.Invoke();
            });
        }
Exemplo n.º 2
0
        internal void OnClose(WebSocket webSocket)
        {
            addMessage(() =>
            {
                lock (_L_registered)
                {
                    if (!_registeredSockets.Remove(webSocket))
                        return;
                }

                RegisteredSocketsChange?.Invoke();
                ProcessDisconnection(webSocket);
            });
        }