Пример #1
0
        void ClientDisconnected(object sender, EventArgs e)
        {
            var sconn = sender as WebSocketConnection;

            if (sconn != null && Connections != null && Connections.Count > 0)
            {
                Connections.Remove(sconn);
                _localServer.DisconnectRequest(sconn.Request);
            }
        }
Пример #2
0
        private void ClientDisconnected(object sender, EventArgs e)
        {
            var c = Connections;

            if (sender is WebSocketConnection sconn && c?.Count > 0)
            {
                try
                {
                    c.Remove(sconn);
                    _localServer.DisconnectRequest(sconn.Request);
                }
                catch
                {
                }
            }
        }
Пример #3
0
        void ClientDisconnected(object sender, EventArgs e)
        {
            var sconn = sender as WebSocketConnection;
            var c     = Connections;

            if (sconn != null && c != null && c.Count > 0)
            {
                try
                {
                    c.Remove(sconn);
                    _localServer.DisconnectRequest(sconn.Request);
                }
                catch
                {
                }
            }
        }