/// <summary> /// 所有登录的客户端主动拉取消息数量 /// </summary> public static void SendMessageAll() { if (_hubInfo.Count > 0) { MessagerController controllerMessage = new MessagerController(HubEntityContract._messageerContract, HubEntityContract._adminContract); foreach (var item in _hubInfo) { var client = AllClients.Client(item.connectionId); int AdminId = item.AdminId.CastTo <int>(); var data = controllerMessage.GetMsgCount(AdminId); client.GetMessage(data.Data); } } }
public static void SendMessage(params int[] AdminIds) { if (AdminIds.IsNotNullThis()) { MessagerController controllerMessage = new MessagerController(HubEntityContract._messageerContract, HubEntityContract._adminContract); foreach (var curDevice in GetCurAdminDeviceIds(AdminIds)) { var client = AllClients.Client(curDevice.connectionId); int AdminId = curDevice.AdminId.CastTo <int>(); var data = controllerMessage.GetMsgCount(AdminId); client.GetMessage(data.Data); } } }