Exemple #1
0
        public void MessageHandler(object sender, MessageArgs args)
        {
            var user = (User)ConnectedUsers.Find(p => p.webSocket == sender);

            if (args.frame.opCode == 1)
            {
                SendAll(user.Username + ": " + Encoding.UTF8.GetString(args.frame.message));
            }
        }
Exemple #2
0
        public void RemoveConectedUser(string connectionId)
        {
            var usertoremove = ConnectedUsers.Find(x => x.ConnectionID == connectionId);

            ConnectedUsers.Remove(usertoremove);
        }