aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/objective-c/GRPCClient
diff options
context:
space:
mode:
authorGravatar Muxi Yan <mxyan@google.com>2018-04-25 14:16:37 -0700
committerGravatar Muxi Yan <mxyan@google.com>2018-05-15 12:39:50 -0700
commit5c30f1cca06a8b42ded32f122784eba44dd50f95 (patch)
treee0c6d9d346efa36312e7dc36fdead202b52e5be9 /src/objective-c/GRPCClient
parent67ff4053b7fa97dc65157b52fdb0713afb7e8830 (diff)
Tweaks to existing components for CFStream
Diffstat (limited to 'src/objective-c/GRPCClient')
-rw-r--r--src/objective-c/GRPCClient/private/GRPCCompletionQueue.m12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/objective-c/GRPCClient/private/GRPCCompletionQueue.m b/src/objective-c/GRPCClient/private/GRPCCompletionQueue.m
index 57dbde8d04..7d14a1c978 100644
--- a/src/objective-c/GRPCClient/private/GRPCCompletionQueue.m
+++ b/src/objective-c/GRPCClient/private/GRPCCompletionQueue.m
@@ -20,6 +20,14 @@
#import <grpc/grpc.h>
+#ifdef GRPC_CFSTREAM
+const grpc_completion_queue_attributes kCompletionQueueAttr = {GRPC_CQ_CURRENT_VERSION,
+ GRPC_CQ_NEXT, GRPC_CQ_NON_POLLING};
+#else
+const grpc_completion_queue_attributes kCompletionQueueAttr = {
+ GRPC_CQ_CURRENT_VERSION, GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING};
+#endif
+
@implementation GRPCCompletionQueue
+ (instancetype)completionQueue {
@@ -33,7 +41,9 @@
- (instancetype)init {
if ((self = [super init])) {
- _unmanagedQueue = grpc_completion_queue_create_for_next(NULL);
+ _unmanagedQueue = grpc_completion_queue_create(
+ grpc_completion_queue_factory_lookup(&kCompletionQueueAttr), &kCompletionQueueAttr, NULL);
+ //_unmanagedQueue = grpc_completion_queue_create_for_next(NULL);
// This is for the following block to capture the pointer by value (instead
// of retaining self and doing self->_unmanagedQueue). This is essential