internal override void OnClientDisconnected(SocketClosedEventArgs e)
        {
            if (ConnectionQueue.ContainsKey(e.UniqueId))
            {
                ConnectionQueue.Remove(e.UniqueId);
            }

            base.OnClientDisconnected(e);
        }
        protected override void OnClose(CloseEventArgs wssArgs)
        {
            var level = UILogLevel.Info;

            if (!wssArgs.WasClean)
            {
                level = UILogLevel.Error;
            }

            var e = new SocketClosedEventArgs
            {
                Address  = null,
                UniqueId = ID
            };

            _socket.OnClientDisconnected(e);
            _socket.OnTrace(level, $"Client disconnected.{Environment.NewLine}Code: {wssArgs.Code}. Reason: {wssArgs.Reason}");
        }
        private void OnClientClose(object sender, CloseEventArgs e)
        {
            var level = UILogLevel.Info;

            if (!e.WasClean)
            {
                level = UILogLevel.Error;
            }

            var ea = new SocketClosedEventArgs
            {
                Address  = Localhost,
                UniqueId = Localhost
            };

            OnClientDisconnected(ea);
            OnTrace(level, $"Disconnected from remote server.{Environment.NewLine}Code: {e.Code}. Reason: {e.Reason}");
        }
Example #4
0
 internal virtual void OnClientDisconnected(SocketClosedEventArgs e)
 {
     ClientDisconnected?.Invoke(this, e);
 }