From 953b21805b47bfbe3146ccb9fbc1886db8877c67 Mon Sep 17 00:00:00 2001 From: SebastianThiebaud Date: Mon, 26 Feb 2018 22:17:54 -0800 Subject: [PATCH] Send status on client for streaming calls --- Sources/gRPC/Call.swift | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Sources/gRPC/Call.swift b/Sources/gRPC/Call.swift index e99a059d4..03e79c1dc 100644 --- a/Sources/gRPC/Call.swift +++ b/Sources/gRPC/Call.swift @@ -219,11 +219,11 @@ public class Call { } operations = [ .sendInitialMetadata(metadata.copy()), + .sendMessage(ByteBuffer(data:message)), + .sendCloseFromClient, .receiveInitialMetadata, + .receiveMessage, .receiveStatusOnClient, - .sendMessage(ByteBuffer(data: message)), - .sendCloseFromClient, - .receiveMessage ] case .serverStreaming: guard let message = message else { @@ -231,14 +231,16 @@ public class Call { } operations = [ .sendInitialMetadata(metadata.copy()), + .sendMessage(ByteBuffer(data:message)), + .sendCloseFromClient, .receiveInitialMetadata, - .sendMessage(ByteBuffer(data: message)), - .sendCloseFromClient + .receiveStatusOnClient, ] case .clientStreaming, .bidiStreaming: operations = [ .sendInitialMetadata(metadata.copy()), - .receiveInitialMetadata + .receiveInitialMetadata, + .receiveStatusOnClient, ] } try perform(OperationGroup(call: self,