Skip to content
Snippets Groups Projects
Commit 0607bae8 authored by Jorge Canizales's avatar Jorge Canizales
Browse files

Forward-declare grpc_channel and specify ownership semantics

parent 7d261ee5
No related branches found
No related tags found
No related merge requests found
......@@ -33,12 +33,14 @@
#import <Foundation/Foundation.h>
#include <grpc/grpc.h>
struct grpc_channel;
// Each separate instance of this class represents at least one TCP connection to the provided host.
// Create them using one of the subclasses |GRPCSecureChannel| and |GRPCUnsecuredChannel|.
@interface GRPCChannel : NSObject
@property(nonatomic, readonly) grpc_channel *unmanagedChannel;
@property(nonatomic, readonly) struct grpc_channel *unmanagedChannel;
- (instancetype)initWithChannel:(grpc_channel *)unmanagedChannel NS_DESIGNATED_INITIALIZER;
// This initializer takes ownership of the passed channel, and will destroy it when this object is
// deallocated. It's illegal to pass the same grpc_channel to two different GRPCChannel objects.
- (instancetype)initWithChannel:(struct grpc_channel *)unmanagedChannel NS_DESIGNATED_INITIALIZER;
@end
......@@ -33,6 +33,8 @@
#import "GRPCChannel.h"
#include <grpc/grpc.h>
@implementation GRPCChannel
- (instancetype)init {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment