private async Task TestSend2() { try { //await MessageBroadcast.ToAllClients("subj here", "test MessageBroadcast.ToAllClients"); await MBHub.BroadcastToAll("subj here", "test MessageBroadcast.ToAllClients"); CommonLogs.Add("MessageBroadcast sent"); } catch (Exception ex) { CommonLogs.Add(ex); } }
private async Task TestSend1() { try { //await MessageBroadcast.RequestClientStates(); await MBHub.All.RequestClientState(); CommonLogs.Add("Sent request for client states."); } catch (Exception ex) { CommonLogs.Add(ex); } }
/// <summary> /// 记录一条日志 /// </summary> /// <param name="log"></param> /// <returns></returns> public bool AddLogs(CommonLogs log) { using (IDbConnection conn = new SqlConnection(DBHelper.GetDBConnection(log.ModuleConfig.ProjectConfig.project_name))) { string query = string.Format(@"INSERT INTO {0}Logs ([log_type] ,[ip] ,[function_name] ,[variables] ,[message] ,[createtime]) VALUES (@log_type ,@ip ,@function_name ,@variables ,@message ,@createtime)", log.ModuleConfig.module_name); return(conn.Execute(query, log) > 0); } }
/// <summary> /// 获取全部日志 /// </summary> /// <param name="log"></param> /// <returns></returns> public List <CommonLogs> GetAllLogs(CommonLogs log) { return(null); }