/// <summary> /// 添加一个任务到队列 /// </summary> public RemoteCallEntrity AddTaskQueue(Guid id, RequestExecutiveInformation info, RRPCSession socket) { var result = new RemoteCallEntrity(id, info, ReceiveMessageState.Wait, DateTime.Now.AddSeconds(second), socket); MethodCallQueues.TryAdd(id, result); return(result); }
/// <summary> /// 添加一个任务到队列 /// </summary> /// <param name="info">信息</param> /// <param name="socket">远程连接</param> /// <returns></returns> public RemoteCallEntrity AddTaskQueue(RequestExecutiveInformation info, FRPCEasyClient socket) { var result = new RemoteCallEntrity(info.ID, info, ReceiveMessageState.Wait, DateTime.Now.AddSeconds(OvertimeSecond), socket); MethodCallQueues.TryAdd(info.ID, result); return(result); }
/// <summary> /// 进行远程调用 /// </summary> /// <param name="info">通讯的信息</param> public void RemoteExecutionFunc(RemoteCallEntrity info) { var msg = JsonConvert.SerializeObject(info.TaskInfo); try { info.ClientSocket.SendMessage(msg); } catch (Exception e) { info.ClientSocket.Log("通讯出现异常" + e.Message, LoggerType.Error); info.ProcessingFuncInvoke(ReceiveMessageState.Error, e.Message); } }
/// <summary> /// 进行远程调用 /// </summary> /// <param name="info">通讯的信息</param> public async void RemoteExecutionFuncAsync(RemoteCallEntrity info) { await Task.Yield(); RemoteExecutionFunc(info); }