コード例 #1
0
        /// <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);
        }
コード例 #2
0
        /// <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);
        }
コード例 #3
0
        /// <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);
            }
        }
コード例 #4
0
        /// <summary>
        /// 进行远程调用
        /// </summary>
        /// <param name="info">通讯的信息</param>
        public async void RemoteExecutionFuncAsync(RemoteCallEntrity info)
        {
            await Task.Yield();

            RemoteExecutionFunc(info);
        }