예제 #1
0
        public async Task <List <FrameInfoPair> > GetFramesWithInfoAsync(
            FrameInfoFlags fields, uint startIndex, uint maxCount)
        {
            var request = new GetFramesWithInfoRequest()
            {
                Thread     = grpcSbThread,
                Fields     = (uint)fields,
                StartIndex = startIndex,
                MaxCount   = maxCount
            };
            GetFramesWithInfoResponse response = null;

            if (await connection.InvokeRpcAsync(async delegate
            {
                response = await client.GetFramesWithInfoAsync(request);
            }))
            {
                return(ToFrameInfoPairList(response));
            }
            return(null);
        }
예제 #2
0
        public override Task <GetFramesWithInfoResponse> GetFramesWithInfo(
            GetFramesWithInfoRequest request, ServerCallContext context)
        {
            var thread         = threadStore.GetObject(request.Thread.Id);
            var framesWithInfo = thread.GetFramesWithInfo((FrameInfoFlags)request.Fields,
                                                          request.StartIndex, request.MaxCount);
            var response = new GetFramesWithInfoResponse();

            foreach (var frameWithInfo in framesWithInfo)
            {
                var grpcFrameWithInfo = new GrpcFrameWithInfo();
                grpcFrameWithInfo.Frame = CreateGrpcSbFrame(frameWithInfo.Frame);
                FrameInfo <SbModule> info = frameWithInfo.Info;
                long?moduleId             = info.Module != null?
                                            moduleStore.AddObject(info.Module) : (long?)null;

                grpcFrameWithInfo.Info = GrpcFactoryUtils.CreateFrameInfo(info, moduleId);
                response.FramesWithInfo.Add(grpcFrameWithInfo);
            }
            return(Task.FromResult(response));
        }
예제 #3
0
        public List <FrameInfoPair> GetFramesWithInfo(
            FrameInfoFlags fields, uint startIndex, uint maxCount)
        {
            var request = new GetFramesWithInfoRequest()
            {
                Thread     = grpcSbThread,
                Fields     = (uint)fields,
                StartIndex = startIndex,
                MaxCount   = maxCount
            };
            GetFramesWithInfoResponse response = null;

            if (connection.InvokeRpc(() =>
            {
                response = client.GetFramesWithInfo(request);
            }))
            {
                return(ToFrameInfoPairList(response));
            }
            return(null);
        }