/// <summary> /// 发送消息 /// </summary> /// <param name="userIds"></param> /// <param name="message"></param> public void SendMessageByUsers(List <string> userIds, string message) { if (_socket != null && userIds.HasVal() && message.HasVal()) { foreach (var uid in userIds) { var connectionIds = GetConnections(uid); if (connectionIds.HasVal()) { foreach (var item in connectionIds) { var connection = _socket.GetConnectionById(item); connection?.Send(message); } } } } }