Browse Source

Update Simple and Echo Xcode projects to fix crashes and use new API.

Tim Burks 8 years ago
parent
commit
9611bbb609

+ 1 - 1
Examples/Echo/Xcode/Echo/EchoViewController.swift

@@ -107,7 +107,7 @@ class EchoViewController : NSViewController, NSTextFieldDelegate {
       return
       return
     }
     }
     if (TLSButton.intValue == 0) {
     if (TLSButton.intValue == 0) {
-      service = Echo_EchoService(address:address)
+      service = Echo_EchoService(address:address, secure:false)
     } else {
     } else {
       let certificateURL = Bundle.main.url(forResource: "ssl",
       let certificateURL = Bundle.main.url(forResource: "ssl",
                                            withExtension: "crt")!
                                            withExtension: "crt")!

+ 10 - 0
Examples/Echo/Xcode/README.md

@@ -0,0 +1,10 @@
+# Echo gRPC Sample App
+
+The Echo Xcode project contains a Mac app that can be used to 
+instantiate and run local gRPC clients and servers. It depends
+on the gRPC Xcode project, which requires a local build of the
+gRPC Core C library. To build that, please run "make" in the
+root of your gRPC distribution. Next use Xcode's "Add Files..."
+command to add the SwiftGRPC.xcodeproj to your project and
+then add the CzLib, gRPC, CgRPC, and BoringSSL libraries
+to the target dependencies of "Echo".

+ 4 - 3
Examples/Simple/Xcode/README.md

@@ -9,7 +9,10 @@ The Simple Xcode project contains a Mac app that can be used to
 instantiate and run local gRPC clients and servers. It depends
 instantiate and run local gRPC clients and servers. It depends
 on the gRPC Xcode project, which requires a local build of the
 on the gRPC Xcode project, which requires a local build of the
 gRPC Core C library. To build that, please run "make" in the
 gRPC Core C library. To build that, please run "make" in the
-root of your gRPC distribution.
+root of your gRPC distribution. Next use Xcode's "Add Files..."
+command to add the SwiftGRPC.xcodeproj to your project and
+then add the CzLib, gRPC, CgRPC, and BoringSSL libraries
+to the target dependencies of "Simple".
 
 
 When running the app, use the "New" menu option to create new
 When running the app, use the "New" menu option to create new
 gRPC sessions. Configure each session using the host and port
 gRPC sessions. Configure each session using the host and port
@@ -17,5 +20,3 @@ fields and the client/server selector, and then press "start"
 to begin serving or calling the server that you've specified.
 to begin serving or calling the server that you've specified.
 
 
 See the "Document" class for client and server implementations.
 See the "Document" class for client and server implementations.
-
-

+ 1 - 1
Examples/Simple/Xcode/Simple/Document.swift

@@ -137,7 +137,7 @@ class Document: NSDocument {
       self.log("Client Starting")
       self.log("Client Starting")
       self.log("GRPC version " + gRPC.version())
       self.log("GRPC version " + gRPC.version())
 
 
-      self.channel = gRPC.Channel(address:address)
+      self.channel = gRPC.Channel(address:address, secure:false)
       self.channel.host = "foo.test.google.fr"
       self.channel.host = "foo.test.google.fr"
       let messageData = "hello, server!".data(using: .utf8)
       let messageData = "hello, server!".data(using: .utf8)