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)); } }
public void RemoveConectedUser(string connectionId) { var usertoremove = ConnectedUsers.Find(x => x.ConnectionID == connectionId); ConnectedUsers.Remove(usertoremove); }