Browse Source

Streamlined error reporting

Tim Burks 9 years ago
parent
commit
909cbad116

+ 9 - 10
Examples/Echo/Swift/Echo/EchoViewController.swift

@@ -105,11 +105,11 @@ class EchoViewController : NSViewController, NSTextFieldDelegate {
         call = client.createCall(host: requestHost,
                                  method: "/echo.Echo/Get",
                                  timeout: 30.0)
-        call.performNonStreamingCall(messageData: requestMessageData,
-                                     metadata: requestMetadata)
-        { (response) in
-          print("Received status: \(response.status) " + response.statusDetails)
-          if let messageData = response.messageData,
+        _ = call.performNonStreamingCall(messageData: requestMessageData,
+                                         metadata: requestMetadata)
+        { (status, statusDetails, messageData, initialMetadata, trailingMetadata) in
+          print("Received status: \(status): \(statusDetails)")
+          if let messageData = messageData,
             let responseMessage = self.fileDescriptorSet.readMessage("EchoResponse",
                                                                      data:messageData) {
             responseMessage.forOneField("text") {(field) in
@@ -119,8 +119,7 @@ class EchoViewController : NSViewController, NSTextFieldDelegate {
             }
           } else {
             DispatchQueue.main.async {
-              self.outputField.stringValue = "No message received. gRPC Status \(response.status) "
-                + response.statusDetails
+              self.outputField.stringValue = "No message received. gRPC Status \(status): \(statusDetails)"
             }
           }
         }
@@ -133,7 +132,7 @@ class EchoViewController : NSViewController, NSTextFieldDelegate {
         call = client.createCall(host: requestHost,
                                  method: "/echo.Echo/Update",
                                  timeout: 30.0)
-        call.start(metadata:requestMetadata)
+        _ = call.start(metadata:requestMetadata)
         self.receiveMessage()
         streaming = true
       }
@@ -149,7 +148,7 @@ class EchoViewController : NSViewController, NSTextFieldDelegate {
   }
 
   func receiveMessage() {
-    call.receiveMessage() {(data) in
+    _ = call.receiveMessage() {(data) in
       let responseMessage = self.fileDescriptorSet.readMessage("EchoResponse", data:data)!
       responseMessage.forOneField("text") {(field) in
         DispatchQueue.main.async {
@@ -161,7 +160,7 @@ class EchoViewController : NSViewController, NSTextFieldDelegate {
   }
 
   func sendClose() {
-    call.close() {
+    _ = call.close() {
       self.streaming = false
     }
   }

+ 9 - 9
Examples/Sessions/Sessions/Document.swift

@@ -171,27 +171,27 @@ class Document: NSDocument {
                                  ["y": "yu"],
                                  ["z": "zither"]])
 
-        call.performNonStreamingCall(messageData: messageData!,
-                                     metadata: metadata)
-        {(response) in
+        _ = call.performNonStreamingCall(messageData: messageData!,
+                                         metadata: metadata)
+        {(status, statusDetails, messageData, initialMetadata, trailingMetadata) in
 
-          if let initialMetadata = response.initialMetadata {
+          if let initialMetadata = initialMetadata {
             for j in 0..<initialMetadata.count() {
               self.log("\(i): Received initial metadata -> " + initialMetadata.key(index:j)
                 + " : " + initialMetadata.value(index:j))
             }
           }
 
-          self.log("\(i): Received status: \(response.status) " + response.statusDetails)
-          if response.status != 0 {
+          self.log("\(i): Received status: \(status) \(statusDetails)")
+          if status != 0 {
             self.setIsRunning(false)
           }
-          if let messageData = response.messageData {
+          if let messageData = messageData {
             let messageString = String(data: messageData as Data, encoding: .utf8)
             self.log("\(i): Received message: " + messageString!)
           }
 
-          if let trailingMetadata = response.trailingMetadata {
+          if let trailingMetadata = trailingMetadata {
             for j in 0..<trailingMetadata.count() {
               self.log("\(i): Received trailing metadata -> " + trailingMetadata.key(index:j)
                 + " : " + trailingMetadata.value(index:j))
@@ -254,7 +254,7 @@ class Document: NSDocument {
 
       self.log("------------------------------")
     }
-
+    
     self.server.onCompletion() {
       self.log("Server Stopped")
       self.updateInterfaceAfterStopping()

+ 0 - 4
Examples/Speech/Speech.xcodeproj/project.pbxproj

@@ -39,7 +39,6 @@
 		D33465CD1D82987700C8D159 /* server.c in Sources */ = {isa = PBXBuildFile; fileRef = D33465C11D82987700C8D159 /* server.c */; };
 		D33465DB1D82989900C8D159 /* ByteBuffer.swift in Sources */ = {isa = PBXBuildFile; fileRef = D33465CF1D82989900C8D159 /* ByteBuffer.swift */; };
 		D33465DC1D82989900C8D159 /* Call.swift in Sources */ = {isa = PBXBuildFile; fileRef = D33465D01D82989900C8D159 /* Call.swift */; };
-		D33465DD1D82989900C8D159 /* CallResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = D33465D11D82989900C8D159 /* CallResponse.swift */; };
 		D33465DE1D82989900C8D159 /* Client.swift in Sources */ = {isa = PBXBuildFile; fileRef = D33465D21D82989900C8D159 /* Client.swift */; };
 		D33465DF1D82989900C8D159 /* CompletionQueue.swift in Sources */ = {isa = PBXBuildFile; fileRef = D33465D31D82989900C8D159 /* CompletionQueue.swift */; };
 		D33465E01D82989900C8D159 /* gRPC.swift in Sources */ = {isa = PBXBuildFile; fileRef = D33465D41D82989900C8D159 /* gRPC.swift */; };
@@ -97,7 +96,6 @@
 		D33465C11D82987700C8D159 /* server.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = server.c; path = ../../Packages/CgRPC/Sources/server.c; sourceTree = "<group>"; };
 		D33465CF1D82989900C8D159 /* ByteBuffer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ByteBuffer.swift; path = ../../Packages/gRPC/Sources/ByteBuffer.swift; sourceTree = "<group>"; };
 		D33465D01D82989900C8D159 /* Call.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Call.swift; path = ../../Packages/gRPC/Sources/Call.swift; sourceTree = "<group>"; };
-		D33465D11D82989900C8D159 /* CallResponse.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = CallResponse.swift; path = ../../Packages/gRPC/Sources/CallResponse.swift; sourceTree = "<group>"; };
 		D33465D21D82989900C8D159 /* Client.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Client.swift; path = ../../Packages/gRPC/Sources/Client.swift; sourceTree = "<group>"; };
 		D33465D31D82989900C8D159 /* CompletionQueue.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = CompletionQueue.swift; path = ../../Packages/gRPC/Sources/CompletionQueue.swift; sourceTree = "<group>"; };
 		D33465D41D82989900C8D159 /* gRPC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = gRPC.swift; path = ../../Packages/gRPC/Sources/gRPC.swift; sourceTree = "<group>"; };
@@ -191,7 +189,6 @@
 			children = (
 				D33465CF1D82989900C8D159 /* ByteBuffer.swift */,
 				D33465D01D82989900C8D159 /* Call.swift */,
-				D33465D11D82989900C8D159 /* CallResponse.swift */,
 				D33465D21D82989900C8D159 /* Client.swift */,
 				D33465D31D82989900C8D159 /* CompletionQueue.swift */,
 				D33465D41D82989900C8D159 /* gRPC.swift */,
@@ -419,7 +416,6 @@
 				D33465DF1D82989900C8D159 /* CompletionQueue.swift in Sources */,
 				D33465E31D82989900C8D159 /* Mutex.swift in Sources */,
 				D3E34EA51D7757CC00EF755D /* ViewController.swift in Sources */,
-				D33465DD1D82989900C8D159 /* CallResponse.swift in Sources */,
 				D33465CC1D82987700C8D159 /* operations.c in Sources */,
 				D33465DE1D82989900C8D159 /* Client.swift in Sources */,
 				D33465A81D82985700C8D159 /* Field.swift in Sources */,

+ 3 - 3
Examples/Speech/Speech/SpeechRecognitionService.swift

@@ -46,7 +46,7 @@ class SpeechRecognitionService {
       if let call = call {
         let metadata = Metadata(["x-goog-api-key":API_KEY,
                                  "x-ios-bundle-identifier":Bundle.main.bundleIdentifier!])
-        call.start(metadata:metadata)
+        _ = call.start(metadata:metadata)
 
         let recognitionConfig = fileDescriptorSet.createMessage("RecognitionConfig")!
         recognitionConfig.addField("encoding", value: 1)
@@ -80,7 +80,7 @@ class SpeechRecognitionService {
 
   func receiveMessage() {
     if let call = call {
-      call.receiveMessage() {(data) in
+      _ = call.receiveMessage() {(data) in
         if let data = data {
           if let responseMessage =
             self.fileDescriptorSet.readMessage("StreamingRecognizeResponse", data:data) {
@@ -107,7 +107,7 @@ class SpeechRecognitionService {
     }
     nowStreaming = false
     if let call = call {
-      call.close {}
+      _ = call.close {}
     }
   }
   

+ 8 - 8
Examples/StickyNotes/StickyNotes/StickyNoteViewController.swift

@@ -79,12 +79,12 @@ class StickyNoteViewController : NSViewController, NSTextFieldDelegate {
 
       client = Client(address:address)
       let call = client.createCall(host: requestHost, method: requestMethod, timeout: 600)
-      call.performNonStreamingCall(messageData: requestMessage.data(),
-                                   metadata: requestMetadata,
-                                   completion:
-        { (response) in
+      _ = call.performNonStreamingCall(messageData: requestMessage.data(),
+                                       metadata: requestMetadata,
+                                       completion:
+        { (status, statusDetails, messageData, initialMetadata, trailingMetadata) in
 
-          if let initialMetadata = response.initialMetadata {
+          if let initialMetadata = initialMetadata {
             for j in 0..<initialMetadata.count() {
               self.log("Received initial metadata -> "
                 + initialMetadata.key(index:j) + " : "
@@ -92,9 +92,9 @@ class StickyNoteViewController : NSViewController, NSTextFieldDelegate {
             }
           }
 
-          self.log("Received status: \(response.status) " + response.statusDetails)
+          self.log("Received status: \(status) \(statusDetails)")
 
-          if let responseData = response.messageData,
+          if let responseData = messageData,
             let responseMessage = fileDescriptorSet.readMessage("StickyNoteResponse",
                                                                 data: responseData) {
             responseMessage.forOneField("image") {(field) in
@@ -106,7 +106,7 @@ class StickyNoteViewController : NSViewController, NSTextFieldDelegate {
             }
           }
 
-          if let trailingMetadata = response.trailingMetadata {
+          if let trailingMetadata = trailingMetadata {
             for j in 0..<trailingMetadata.count() {
               self.log("Received trailing metadata -> "
                 + trailingMetadata.key(index:j) + " : "

+ 61 - 69
Packages/gRPC/Sources/Call.swift

@@ -44,6 +44,9 @@ private class CallLock {
   static let sharedInstance = CallLock()
 }
 
+public typealias CallCompletion = (Int, String?, Data?, Metadata?, Metadata?) -> Void
+public typealias SendMessageCompletion = (grpc_call_error) -> Void
+
 /// A gRPC API call
 public class Call {
 
@@ -96,7 +99,6 @@ public class Call {
       return error
   }
 
-
   /// Performs a nonstreaming gRPC API call
   ///
   /// - Parameter message: a ByteBuffer containing the message to send
@@ -104,7 +106,7 @@ public class Call {
   /// - Returns: a CallResponse object containing results of the call
   public func performNonStreamingCall(messageData: Data,
                                       metadata: Metadata,
-                                      completion: @escaping ((CallResponse) -> Void)) -> Void   {
+                                      completion: @escaping CallCompletion) -> grpc_call_error {
 
     let messageBuffer = ByteBuffer(data:messageData)
 
@@ -121,80 +123,85 @@ public class Call {
                                            operation_sendCloseFromClient,
                                            operation_receiveInitialMetadata,
                                            operation_receiveStatusOnClient,
-                                           operation_receiveMessage])
-    { (success) in
-      if success {
-        let response = CallResponse(status:operation_receiveStatusOnClient.status(),
-                                    statusDetails:operation_receiveStatusOnClient.statusDetails(),
-                                    message:operation_receiveMessage.message(),
-                                    initialMetadata:operation_receiveInitialMetadata.metadata(),
-                                    trailingMetadata:operation_receiveStatusOnClient.metadata())
-        completion(response)
-      } else {
-        completion(CallResponse())
-      }
-    }
-    let call_error = self.perform(call: self, operations: group)
-    if call_error != GRPC_CALL_OK {
-      print ("call error = \(call_error)")
-    }
+                                           operation_receiveMessage],
+                               completion:
+      {(success) in
+        if success {
+          completion(operation_receiveStatusOnClient.status(),
+                     operation_receiveStatusOnClient.statusDetails(),
+                     operation_receiveMessage.message()?.data(),
+                     operation_receiveInitialMetadata.metadata(),
+                     operation_receiveStatusOnClient.metadata())
+        } else {
+          completion(0, nil, nil, nil, nil)
+        }
+    })
+
+    return self.perform(operations: group)
   }
 
   // perform a group of operations (used internally)
-  private func perform(call: Call, operations: OperationGroup) -> grpc_call_error {
+  private func perform(operations: OperationGroup) -> grpc_call_error {
     self.completionQueue.operationGroups[operations.tag] = operations
-    return call.performOperations(operations:operations,
-                                  tag:operations.tag,
-                                  completionQueue: self.completionQueue)
+    return performOperations(operations:operations,
+                             tag:operations.tag,
+                             completionQueue: self.completionQueue)
   }
 
   // start a streaming connection
-  public func start(metadata: Metadata) {
-    self.sendInitialMetadata(metadata: metadata)
-    self.receiveInitialMetadata()
-    self.receiveStatus()
+  public func start(metadata: Metadata) -> grpc_call_error {
+    var error : grpc_call_error
+    error = self.sendInitialMetadata(metadata: metadata)
+    if error != GRPC_CALL_OK {
+      return error
+    }
+    error = self.receiveInitialMetadata()
+    if error != GRPC_CALL_OK {
+      return error
+    }
+    return self.receiveStatus()
   }
 
   // send a message over a streaming connection
-  public func sendMessage(data: Data) {
+  public func sendMessage(data: Data,
+                          callback:@escaping SendMessageCompletion = {(error) in })
+    -> Void {
     DispatchQueue.main.async {
       if self.writing {
-        self.pendingMessages.append(data)
+        self.pendingMessages.append(data) // TODO: return something if we can't accept another message
+        callback(GRPC_CALL_OK)
       } else {
         self.writing = true
-        self.sendWithoutBlocking(data: data)
+        let error = self.sendWithoutBlocking(data: data)
+        callback(error)
       }
     }
   }
 
-  private func sendWithoutBlocking(data: Data) {
+  private func sendWithoutBlocking(data: Data) -> grpc_call_error {
     let messageBuffer = ByteBuffer(data:data)
     let operation_sendMessage = Operation_SendMessage(message:messageBuffer)
     let operations = OperationGroup(call:self, operations:[operation_sendMessage])
     { (event) in
 
-      // if the event failed, shut down
-
+      // TODO: if the event failed, shut down
 
       DispatchQueue.main.async {
-      if self.pendingMessages.count > 0 {
-        let nextMessage = self.pendingMessages.first!
-        self.pendingMessages.removeFirst()
-        self.sendWithoutBlocking(data: nextMessage)
-      } else {
-        self.writing = false
+        if self.pendingMessages.count > 0 {
+          let nextMessage = self.pendingMessages.first!
+          self.pendingMessages.removeFirst()
+          _ = self.sendWithoutBlocking(data: nextMessage)
+        } else {
+          self.writing = false
+        }
       }
-      }
-    }
-    let call_error = self.perform(call:self, operations:operations)
-    if call_error != GRPC_CALL_OK {
-      print("call error \(call_error)")
     }
+    return self.perform(operations:operations)
   }
 
 
   // receive a message over a streaming connection
-  public func receiveMessage(callback:@escaping ((Data!) -> Void)) -> Void {
+  public func receiveMessage(callback:@escaping ((Data!) -> Void)) -> grpc_call_error {
     let operation_receiveMessage = Operation_ReceiveMessage()
     let operations = OperationGroup(call:self, operations:[operation_receiveMessage])
     { (event) in
@@ -202,14 +209,11 @@ public class Call {
         callback(messageBuffer.data())
       }
     }
-    let call_error = self.perform(call:self, operations:operations)
-    if call_error != GRPC_CALL_OK {
-      print("call error \(call_error)")
-    }
+    return self.perform(operations:operations)
   }
 
   // send initial metadata over a streaming connection
-  private func sendInitialMetadata(metadata: Metadata) {
+  private func sendInitialMetadata(metadata: Metadata) -> grpc_call_error {
     let operation_sendInitialMetadata = Operation_SendInitialMetadata(metadata:metadata);
     let operations = OperationGroup(call:self, operations:[operation_sendInitialMetadata])
     { (success) in
@@ -219,14 +223,11 @@ public class Call {
         return
       }
     }
-    let call_error = self.perform(call:self, operations:operations)
-    if call_error != GRPC_CALL_OK {
-      print("call error: \(call_error)")
-    }
+    return self.perform(operations:operations)
   }
 
   // receive initial metadata from a streaming connection
-  private func receiveInitialMetadata() {
+  private func receiveInitialMetadata() -> grpc_call_error {
     let operation_receiveInitialMetadata = Operation_ReceiveInitialMetadata()
     let operations = OperationGroup(call:self, operations:[operation_receiveInitialMetadata])
     { (event) in
@@ -235,36 +236,27 @@ public class Call {
         print("Received initial metadata -> " + initialMetadata.key(index:j) + " : " + initialMetadata.value(index:j))
       }
     }
-    let call_error = self.perform(call:self, operations:operations)
-    if call_error != GRPC_CALL_OK {
-      print("call error \(call_error)")
-    }
+    return self.perform(operations:operations)
   }
 
   // receive status from a streaming connection
-  private func receiveStatus() {
+  private func receiveStatus() -> grpc_call_error {
     let operation_receiveStatus = Operation_ReceiveStatusOnClient()
     let operations = OperationGroup(call:self,
                                     operations:[operation_receiveStatus])
     { (event) in
       print("status = \(operation_receiveStatus.status()), \(operation_receiveStatus.statusDetails())")
     }
-    let call_error = self.perform(call:self, operations:operations)
-    if call_error != GRPC_CALL_OK {
-      print("call error \(call_error)")
-    }
+    return self.perform(operations:operations)
   }
 
   // close a streaming connection
-  public func close(completion:@escaping (() -> Void)) {
+  public func close(completion:@escaping (() -> Void)) -> grpc_call_error {
     let operation_sendCloseFromClient = Operation_SendCloseFromClient()
     let operations = OperationGroup(call:self, operations:[operation_sendCloseFromClient])
     { (event) in
       completion()
     }
-    let call_error = self.perform(call:self, operations:operations)
-    if call_error != GRPC_CALL_OK {
-      print("call error \(call_error)")
-    }
+    return self.perform(operations:operations)
   }
 }

+ 0 - 113
Packages/gRPC/Sources/CallResponse.swift

@@ -1,113 +0,0 @@
-/*
- *
- * Copyright 2016, Google Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-#if SWIFT_PACKAGE
-  import CgRPC
-#endif
-import Foundation
-
-/// Representation of a response to a gRPC call
-public class CallResponse {
-
-  /// Error code that could be generated when the call is created
-  public var error: grpc_call_error
-
-  /// Result of waiting for call completion
-  public var completion: grpc_completion_type
-
-  /// Status code returned by server
-  public var status: Int
-
-  /// Status message optionally returned by server
-  public var statusDetails: String
-
-  /// Message returned by server
-  public var messageData: Data?
-
-  /// Initial metadata returned by server
-  public var initialMetadata: Metadata?
-
-  /// Trailing metadata returned by server
-  public var trailingMetadata: Metadata?
-
-  /// Initializes a response when error != GRPC_CALL_OK
-  ///
-  /// - Parameter error: an error code from when the call was performed
-  public init(error: grpc_call_error) {
-    self.error = error
-    self.completion = GRPC_OP_COMPLETE
-    self.status = 0
-    self.statusDetails = ""
-  }
-
-  /// Initializes a response when completion != GRPC_OP_COMPLETE
-  ///
-  /// - Parameter completion: a code indicating the result of waiting for the call to complete
-  public init(completion: grpc_completion_type) {
-    self.error = GRPC_CALL_OK
-    self.completion = completion
-    self.status = 0
-    self.statusDetails = ""
-  }
-
-
-  public init() {
-    self.error = GRPC_CALL_ERROR
-    self.completion = GRPC_OP_COMPLETE
-    self.status = 0
-    self.statusDetails = ""
-  }
-
-
-  /// Initializes a response when error == GRPC_CALL_OK and completion == GRPC_OP_COMPLETE
-  ///
-  /// - Parameter status: a status code returned from the server
-  /// - Parameter statusDetails: a status string returned from the server
-  /// - Parameter message: a buffer containing results returned from the server
-  /// - Parameter initialMetadata: initial metadata returned by the server
-  /// - Parameter trailingMetadata: trailing metadata returned by the server
-  init(status:Int,
-       statusDetails:String,
-       message:ByteBuffer?,
-       initialMetadata:Metadata?,
-       trailingMetadata:Metadata?) {
-    self.error = GRPC_CALL_OK
-    self.completion = GRPC_OP_COMPLETE
-    self.status = status
-    self.statusDetails = statusDetails
-    if let message = message {
-      self.messageData = message.data()
-    }
-    self.initialMetadata = initialMetadata
-    self.trailingMetadata = trailingMetadata
-  }
-}

+ 32 - 8
QuickProto/QuickProtoApp/AppDelegate.swift

@@ -1,11 +1,35 @@
-//
-//  AppDelegate.swift
-//  QuickProtoApp
-//
-//  Created by Tim Burks on 9/15/16.
-//  Copyright © 2016 Google. All rights reserved.
-//
-
+/*
+ *
+ * Copyright 2016, Google Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
 import Cocoa
 
 @NSApplicationMain

+ 0 - 4
gRPC.xcodeproj/project.pbxproj

@@ -8,7 +8,6 @@
 
 /* Begin PBXBuildFile section */
 		D31C3E401D863E9C008676EF /* roots.pem in Resources */ = {isa = PBXBuildFile; fileRef = D31C3E3F1D863E9C008676EF /* roots.pem */; };
-		D32F10121D5CEE880071B7C1 /* CallResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = D32F10111D5CEE880071B7C1 /* CallResponse.swift */; };
 		D34B4BB81D7B2C9B00B8B5E2 /* OperationGroup.swift in Sources */ = {isa = PBXBuildFile; fileRef = D34B4BB71D7B2C9B00B8B5E2 /* OperationGroup.swift */; };
 		D34B4BBA1D7B2CB200B8B5E2 /* operations.c in Sources */ = {isa = PBXBuildFile; fileRef = D34B4BB91D7B2CB200B8B5E2 /* operations.c */; };
 		D37DD0281D7D09CB009AEB74 /* event.c in Sources */ = {isa = PBXBuildFile; fileRef = D37DD0271D7D09CB009AEB74 /* event.c */; };
@@ -40,7 +39,6 @@
 
 /* Begin PBXFileReference section */
 		D31C3E3F1D863E9C008676EF /* roots.pem */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = roots.pem; sourceTree = "<group>"; };
-		D32F10111D5CEE880071B7C1 /* CallResponse.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = CallResponse.swift; path = Packages/gRPC/Sources/CallResponse.swift; sourceTree = "<group>"; };
 		D34B4BB71D7B2C9B00B8B5E2 /* OperationGroup.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = OperationGroup.swift; path = Packages/gRPC/Sources/OperationGroup.swift; sourceTree = "<group>"; };
 		D34B4BB91D7B2CB200B8B5E2 /* operations.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = operations.c; path = Packages/CgRPC/Sources/operations.c; sourceTree = "<group>"; };
 		D37DD0271D7D09CB009AEB74 /* event.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = event.c; path = Packages/CgRPC/Sources/event.c; sourceTree = "<group>"; };
@@ -110,7 +108,6 @@
 			children = (
 				D3AC86BB1D5BEBE00042B341 /* ByteBuffer.swift */,
 				D3AC86BC1D5BEBE00042B341 /* Call.swift */,
-				D32F10111D5CEE880071B7C1 /* CallResponse.swift */,
 				D3AC86BD1D5BEBE00042B341 /* Client.swift */,
 				D3AC86BE1D5BEBE00042B341 /* CompletionQueue.swift */,
 				D3AC86BF1D5BEBE00042B341 /* gRPC.swift */,
@@ -265,7 +262,6 @@
 				D3AC86CA1D5BEBE00042B341 /* Handler.swift in Sources */,
 				D3AC86CD1D5BEBE00042B341 /* Operation.swift in Sources */,
 				D37DD0281D7D09CB009AEB74 /* event.c in Sources */,
-				D32F10121D5CEE880071B7C1 /* CallResponse.swift in Sources */,
 				D3AC86CE1D5BEBE00042B341 /* Server.swift in Sources */,
 				D3AC86C71D5BEBE00042B341 /* Client.swift in Sources */,
 				D3AC86C51D5BEBE00042B341 /* ByteBuffer.swift in Sources */,