aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/csharp/Grpc.Core/GrpcEnvironment.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/csharp/Grpc.Core/GrpcEnvironment.cs')
-rw-r--r--src/csharp/Grpc.Core/GrpcEnvironment.cs16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/csharp/Grpc.Core/GrpcEnvironment.cs b/src/csharp/Grpc.Core/GrpcEnvironment.cs
index e7c04185c2..3797100fc6 100644
--- a/src/csharp/Grpc.Core/GrpcEnvironment.cs
+++ b/src/csharp/Grpc.Core/GrpcEnvironment.cs
@@ -47,15 +47,6 @@ namespace Grpc.Core
{
const int THREAD_POOL_SIZE = 4;
- [DllImport("grpc_csharp_ext.dll")]
- static extern void grpcsharp_init();
-
- [DllImport("grpc_csharp_ext.dll")]
- static extern void grpcsharp_shutdown();
-
- [DllImport("grpc_csharp_ext.dll")]
- static extern IntPtr grpcsharp_version_string(); // returns not-owned const char*
-
static object staticLock = new object();
static GrpcEnvironment instance;
static int refCount;
@@ -136,7 +127,6 @@ namespace Grpc.Core
/// </summary>
private GrpcEnvironment()
{
- NativeLogRedirector.Redirect();
GrpcNativeInit();
completionRegistry = new CompletionRegistry(this);
threadPool = new GrpcThreadPool(this, THREAD_POOL_SIZE);
@@ -181,18 +171,18 @@ namespace Grpc.Core
/// </summary>
internal static string GetCoreVersionString()
{
- var ptr = grpcsharp_version_string(); // the pointer is not owned
+ var ptr = NativeMethods.Get().grpcsharp_version_string(); // the pointer is not owned
return Marshal.PtrToStringAnsi(ptr);
}
internal static void GrpcNativeInit()
{
- grpcsharp_init();
+ NativeMethods.Get().grpcsharp_init();
}
internal static void GrpcNativeShutdown()
{
- grpcsharp_shutdown();
+ NativeMethods.Get().grpcsharp_shutdown();
}
/// <summary>