public override Task <StatusResponse> PostLargePayload(MeteoriteLandingList request, ServerCallContext context) { Console.WriteLine(">> PostLargePayload called: {0}", request); return(Task.FromResult(new StatusResponse { Status = "SUCCESS" })); }
private NetMQMessage GetLargePayloadMessage(MeteoriteLandingList meteoriteLandings) { var message = new NetMQMessage(); message.Append(BitConverter.GetBytes((int)RequestType.PostLargePayload)); message.Append(meteoriteLandings.ToByteArray()); return(message); }
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; })); }
public async Task <string> PostLargePayloadAsync(MeteoriteLandingList meteoriteLandings) { return((await client.PostLargePayloadAsync(meteoriteLandings)).Status); }
public override Task <StatusResponse> PostLargePayload(MeteoriteLandingList request, ServerCallContext context) { return(Task.FromResult(new StatusResponse { Status = "SUCCESS" })); }
public override async Task <StatusResponse> PostLargePayload(MeteoriteLandingList request, ServerCallContext context) { // return Task.FromResult( (StatusResponse)(await client.PostLargePayloadAsync(request)).Status ); return(await client.PostLargePayloadAsync(request)); }