Use new transport selector

pull/20899/head
Muxi Yan 5 years ago
parent feae38d3ab
commit d2f96d6d64
  1. 3
      examples/objective-c/helloworld/main.m
  2. 3
      examples/objective-c/helloworld_macos/main.m
  3. 10
      examples/objective-c/route_guide/ViewControllers.m

@ -21,6 +21,7 @@
#import <GRPCClient/GRPCCall+ChannelArg.h>
#import <GRPCClient/GRPCCall+Tests.h>
#import <GRPCClient/GRPCTransport.h>
#if COCOAPODS
#import <HelloWorld/Helloworld.pbrpc.h>
#else
@ -55,7 +56,7 @@ int main(int argc, char * argv[]) {
GRPCMutableCallOptions *options = [[GRPCMutableCallOptions alloc] init];
// this example does not use TLS (secure channel); use insecure channel instead
options.transportType = GRPCTransportTypeInsecure;
options.transport = GRPCDefaultTransportImplList.core_insecure;
options.userAgentPrefix = @"HelloWorld/1.0";
GRPCUnaryProtoCall *call = [client sayHelloWithMessage:request

@ -20,6 +20,7 @@
#import <GRPCClient/GRPCCall+ChannelArg.h>
#import <GRPCClient/GRPCCall+Tests.h>
#import <GRPCClient/GRPCTransport.h>
#if COCOAPODS
#import <HelloWorld/Helloworld.pbrpc.h>
#else
@ -54,7 +55,7 @@ int main(int argc, const char * argv[]) {
GRPCMutableCallOptions *options = [[GRPCMutableCallOptions alloc] init];
// this example does not use TLS (secure channel); use insecure channel instead
options.transportType = GRPCTransportTypeInsecure;
options.transport = GRPCDefaultTransportImplList.core_insecure;
options.userAgentPrefix = @"HelloWorld/1.0";
GRPCUnaryProtoCall *call = [client sayHelloWithMessage:request

@ -23,6 +23,8 @@
#import "examples/protos/RouteGuide.pbrpc.h"
#endif
#import <GRPCClient/GRPCTransport.h>
static NSString * const kHostAddress = @"localhost:50051";
/** Category to override RTGPoint's description. */
@ -123,7 +125,7 @@ static NSString * const kHostAddress = @"localhost:50051";
[super viewDidLoad];
GRPCMutableCallOptions *options = [[GRPCMutableCallOptions alloc] init];
options.transportType = GRPCTransportTypeInsecure;
options.transport = GRPCDefaultTransportImplList.core_insecure;
_service = [[RTGRouteGuide alloc] initWithHost:kHostAddress callOptions:options];
}
@ -193,7 +195,7 @@ static NSString * const kHostAddress = @"localhost:50051";
[super viewDidLoad];
GRPCMutableCallOptions *options = [[GRPCMutableCallOptions alloc] init];
options.transportType = GRPCTransportTypeInsecure;
options.transport = GRPCDefaultTransportImplList.core_insecure;
_service = [[RTGRouteGuide alloc] initWithHost:kHostAddress callOptions:options];
}
@ -286,7 +288,7 @@ static NSString * const kHostAddress = @"localhost:50051";
[super viewDidLoad];
GRPCMutableCallOptions *options = [[GRPCMutableCallOptions alloc] init];
options.transportType = GRPCTransportTypeInsecure;
options.transport = GRPCDefaultTransportImplList.core_insecure;
_service = [[RTGRouteGuide alloc] initWithHost:kHostAddress callOptions:options];
}
@ -360,7 +362,7 @@ static NSString * const kHostAddress = @"localhost:50051";
[super viewDidLoad];
GRPCMutableCallOptions *options = [[GRPCMutableCallOptions alloc] init];
options.transportType = GRPCTransportTypeInsecure;
options.transport = GRPCDefaultTransportImplList.core_insecure;
_service = [[RTGRouteGuide alloc] initWithHost:kHostAddress callOptions:options];
}

Loading…
Cancel
Save