Browse Source

Merge pull request #149 from MrMage/call-shutdown-server-side

Also call `shutdown` in `Handler.sendStatus`
Tim Burks 8 years ago
parent
commit
7dfcca99af
1 changed files with 3 additions and 6 deletions
  1. 3 6
      Sources/gRPC/Handler.swift

+ 3 - 6
Sources/gRPC/Handler.swift

@@ -119,9 +119,7 @@ public class Handler {
                                       .sendStatusFromServer(statusCode, statusMessage, trailingMetadata),
                                       .sendMessage(messageBuffer)
     ]) { operationGroup in
-      if operationGroup.success {
-        self.shutdown()
-      }
+      self.shutdown()
     }
     try call.perform(operations)
   }
@@ -139,9 +137,7 @@ public class Handler {
                                       .receiveCloseOnServer,
                                       .sendStatusFromServer(statusCode, statusMessage, trailingMetadata)
     ]) { operationGroup in
-      if operationGroup.success {
-        self.shutdown()
-      }
+      self.shutdown()
     }
     try call.perform(operations)
   }
@@ -234,6 +230,7 @@ public class Handler {
       if operationGroup.success {
         completion()
       }
+      self.shutdown()
     }
     try call.perform(operations)
   }