aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/csharp/Grpc.Core/GrpcEnvironment.cs
diff options
context:
space:
mode:
authorGravatar murgatroid99 <mlumish@google.com>2015-08-11 17:28:42 -0700
committerGravatar murgatroid99 <mlumish@google.com>2015-08-11 17:28:42 -0700
commit9e2b7c81b10f79085df25a27fd2ab4b37e7d00e5 (patch)
tree6a98eedeb3353289bee6ea5b44af8cbb62e031fa /src/csharp/Grpc.Core/GrpcEnvironment.cs
parenta16b5ef455c63a18929b4ef90945e90f01c1fd58 (diff)
parent9a2a3aecc8f7d667df0236df0367bb59a4ae37b1 (diff)
Resolved merge conflicts with master
Diffstat (limited to 'src/csharp/Grpc.Core/GrpcEnvironment.cs')
-rw-r--r--src/csharp/Grpc.Core/GrpcEnvironment.cs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/csharp/Grpc.Core/GrpcEnvironment.cs b/src/csharp/Grpc.Core/GrpcEnvironment.cs
index 034a66be3c..1bb83c9962 100644
--- a/src/csharp/Grpc.Core/GrpcEnvironment.cs
+++ b/src/csharp/Grpc.Core/GrpcEnvironment.cs
@@ -53,6 +53,9 @@ namespace Grpc.Core
[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;
@@ -164,6 +167,15 @@ namespace Grpc.Core
}
/// <summary>
+ /// Gets version of gRPC C core.
+ /// </summary>
+ internal static string GetCoreVersionString()
+ {
+ var ptr = grpcsharp_version_string(); // the pointer is not owned
+ return Marshal.PtrToStringAnsi(ptr);
+ }
+
+ /// <summary>
/// Shuts down this environment.
/// </summary>
private void Close()