public override Task <StatusResponse> PostLargePayload(MeteoriteLandingList request, ServerCallContext context)
 {
     Console.WriteLine(">> PostLargePayload called: {0}", request);
     return(Task.FromResult(new StatusResponse {
         Status = "SUCCESS"
     }));
 }
Ejemplo n.º 2
0
        private NetMQMessage GetLargePayloadMessage(MeteoriteLandingList meteoriteLandings)
        {
            var message = new NetMQMessage();

            message.Append(BitConverter.GetBytes((int)RequestType.PostLargePayload));

            message.Append(meteoriteLandings.ToByteArray());

            return(message);
        }
Ejemplo n.º 3
0
        public async Task <string> PostLargePayloadAsync(MeteoriteLandingList meteoriteLandings)
        {
            return(await Task.Run(() =>
            {
                _client.SendMultipartMessage(GetLargePayloadMessage(meteoriteLandings));

                var response = _client.ReceiveMultipartMessage();

                if (response != null && response.FrameCount == 2)
                {
                    var requestType = ReadRequestType(response[0]);

                    if (requestType == RequestType.PostLargePayload)
                    {
                        var statusResponse = StatusResponse.Parser.ParseFrom(response[1].Buffer);

                        return statusResponse.Status;
                    }
                }

                return string.Empty;
            }));
        }
Ejemplo n.º 4
0
 public async Task <string> PostLargePayloadAsync(MeteoriteLandingList meteoriteLandings)
 {
     return((await client.PostLargePayloadAsync(meteoriteLandings)).Status);
 }
Ejemplo n.º 5
0
 public override Task <StatusResponse> PostLargePayload(MeteoriteLandingList request, ServerCallContext context)
 {
     return(Task.FromResult(new StatusResponse {
         Status = "SUCCESS"
     }));
 }
Ejemplo n.º 6
0
 public override async Task <StatusResponse> PostLargePayload(MeteoriteLandingList request, ServerCallContext context)
 {
     // return Task.FromResult( (StatusResponse)(await client.PostLargePayloadAsync(request)).Status );
     return(await client.PostLargePayloadAsync(request));
 }