public static CredentialsSafeHandle CreateNullCredentials()
        {
            var creds = new CredentialsSafeHandle();

            creds.SetHandle(IntPtr.Zero);
            return(creds);
        }
Exemple #2
0
 public static ChannelSafeHandle CreateSecure(CredentialsSafeHandle credentials, string target, ChannelArgsSafeHandle channelArgs)
 {
     // Increment reference count for the native gRPC environment to make sure we don't do grpc_shutdown() before destroying the server handle.
     // Doing so would make object finalizer crash if we end up abandoning the handle.
     GrpcEnvironment.GrpcNativeInit();
     return grpcsharp_secure_channel_create(credentials, target, channelArgs);
 }
Exemple #3
0
 public static ChannelSafeHandle CreateSecure(CredentialsSafeHandle credentials, string target, ChannelArgsSafeHandle channelArgs)
 {
     // Increment reference count for the native gRPC environment to make sure we don't do grpc_shutdown() before destroying the server handle.
     // Doing so would make object finalizer crash if we end up abandoning the handle.
     GrpcEnvironment.GrpcNativeInit();
     return(grpcsharp_secure_channel_create(credentials, target, channelArgs));
 }
        public NativeMetadataCredentialsPlugin(AsyncAuthInterceptor interceptor)
        {
            this.interceptor = Preconditions.CheckNotNull(interceptor, "interceptor");
            this.nativeInterceptor = NativeMetadataInterceptorHandler;

            // Make sure the callback doesn't get garbage collected until it is destroyed.
            this.gcHandle = GCHandle.Alloc(this.nativeInterceptor, GCHandleType.Normal);
            this.credentials = grpcsharp_metadata_credentials_create_from_plugin(nativeInterceptor);
        }
        public NativeMetadataCredentialsPlugin(AsyncAuthInterceptor interceptor)
        {
            this.interceptor       = Preconditions.CheckNotNull(interceptor, "interceptor");
            this.nativeInterceptor = NativeMetadataInterceptorHandler;

            // Make sure the callback doesn't get garbage collected until it is destroyed.
            this.gcHandle    = GCHandle.Alloc(this.nativeInterceptor, GCHandleType.Normal);
            this.credentials = grpcsharp_metadata_credentials_create_from_plugin(nativeInterceptor);
        }
Exemple #6
0
 public CallSafeHandle CreateCall(CompletionRegistry registry, CallSafeHandle parentCall, ContextPropagationFlags propagationMask, CompletionQueueSafeHandle cq, string method, string host, Timespec deadline, CredentialsSafeHandle credentials)
 {
     using (Profilers.ForCurrentThread().NewScope("ChannelSafeHandle.CreateCall"))
     {
         var result = grpcsharp_channel_create_call(this, parentCall, propagationMask, cq, method, host, deadline);
         if (credentials != null)
         {
             result.SetCredentials(credentials);
         }
         result.SetCompletionRegistry(registry);
         return result;
     }
 }
Exemple #7
0
 public void SetCredentials(CredentialsSafeHandle credentials)
 {
     grpcsharp_call_set_credentials(this, credentials).CheckOk();
 }
Exemple #8
0
 public static ChannelSafeHandle CreateSecure(CredentialsSafeHandle credentials, string target, ChannelArgsSafeHandle channelArgs)
 {
     return grpcsharp_secure_channel_create(credentials, target, channelArgs);
 }
Exemple #9
0
 static extern ChannelSafeHandle grpcsharp_secure_channel_create(CredentialsSafeHandle credentials, string target, ChannelArgsSafeHandle channelArgs);
Exemple #10
0
 static extern ChannelSafeHandle grpcsharp_secure_channel_create(CredentialsSafeHandle credentials, string target, ChannelArgsSafeHandle channelArgs);
Exemple #11
0
 public static CredentialsSafeHandle CreateComposite(CredentialsSafeHandle creds1, CredentialsSafeHandle creds2)
 {
     return grpcsharp_composite_credentials_create(creds1, creds2);
 }
Exemple #12
0
 public static ChannelSafeHandle CreateSecure(CredentialsSafeHandle credentials, string target, ChannelArgsSafeHandle channelArgs)
 {
     return(grpcsharp_secure_channel_create(credentials, target, channelArgs));
 }
Exemple #13
0
 static extern GRPCCallError grpcsharp_call_set_credentials(CallSafeHandle call, CredentialsSafeHandle credentials);
Exemple #14
0
 public void SetCredentials(CredentialsSafeHandle credentials)
 {
     grpcsharp_call_set_credentials(this, credentials).CheckOk();
 }
Exemple #15
0
 static extern GRPCCallError grpcsharp_call_set_credentials(CallSafeHandle call, CredentialsSafeHandle credentials);
 public static CredentialsSafeHandle CreateComposite(CredentialsSafeHandle creds1, CredentialsSafeHandle creds2)
 {
     return(grpcsharp_composite_credentials_create(creds1, creds2));
 }
 static extern CredentialsSafeHandle grpcsharp_composite_credentials_create(CredentialsSafeHandle creds1, CredentialsSafeHandle creds2);
 public static CredentialsSafeHandle CreateNullCredentials()
 {
     var creds = new CredentialsSafeHandle();
     creds.SetHandle(IntPtr.Zero);
     return creds;
 }
        public CallSafeHandle CreateCall(CompletionRegistry registry, CallSafeHandle parentCall, ContextPropagationFlags propagationMask, CompletionQueueSafeHandle cq, string method, string host, Timespec deadline, CredentialsSafeHandle credentials)
        {
            var result = grpcsharp_channel_create_call(this, parentCall, propagationMask, cq, method, host, deadline);

            if (credentials != null)
            {
                result.SetCredentials(credentials);
            }
            result.SetCompletionRegistry(registry);
            return(result);
        }
Exemple #20
0
 static extern CredentialsSafeHandle grpcsharp_composite_credentials_create(CredentialsSafeHandle creds1, CredentialsSafeHandle creds2);