Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
c5a6aca3
Commit
c5a6aca3
authored
9 years ago
by
Jan Tattermusch
Browse files
Options
Downloads
Patches
Plain Diff
expose C core version string to C#
parent
7a759360
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/csharp/Grpc.Core/GrpcEnvironment.cs
+12
-0
12 additions, 0 deletions
src/csharp/Grpc.Core/GrpcEnvironment.cs
src/csharp/ext/grpc_csharp_ext.c
+5
-0
5 additions, 0 deletions
src/csharp/ext/grpc_csharp_ext.c
with
17 additions
and
0 deletions
src/csharp/Grpc.Core/GrpcEnvironment.cs
+
12
−
0
View file @
c5a6aca3
...
@@ -53,6 +53,9 @@ namespace Grpc.Core
...
@@ -53,6 +53,9 @@ namespace Grpc.Core
[
DllImport
(
"grpc_csharp_ext.dll"
)]
[
DllImport
(
"grpc_csharp_ext.dll"
)]
static
extern
void
grpcsharp_shutdown
();
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
object
staticLock
=
new
object
();
static
GrpcEnvironment
instance
;
static
GrpcEnvironment
instance
;
...
@@ -163,6 +166,15 @@ namespace Grpc.Core
...
@@ -163,6 +166,15 @@ namespace Grpc.Core
}
}
}
}
/// <summary>
/// Gets version of gRPC C core.
/// </summary>
internal
string
GetCoreVersionString
()
{
var
ptr
=
grpcsharp_version_string
();
// the pointer is not owned
return
Marshal
.
PtrToStringAnsi
(
ptr
);
}
/// <summary>
/// <summary>
/// Shuts down this environment.
/// Shuts down this environment.
/// </summary>
/// </summary>
...
...
This diff is collapsed.
Click to expand it.
src/csharp/ext/grpc_csharp_ext.c
+
5
−
0
View file @
c5a6aca3
...
@@ -849,6 +849,11 @@ GPR_EXPORT void GPR_CALLTYPE grpcsharp_redirect_log(grpcsharp_log_func func) {
...
@@ -849,6 +849,11 @@ GPR_EXPORT void GPR_CALLTYPE grpcsharp_redirect_log(grpcsharp_log_func func) {
typedef
void
(
GPR_CALLTYPE
*
test_callback_funcptr
)(
gpr_int32
success
);
typedef
void
(
GPR_CALLTYPE
*
test_callback_funcptr
)(
gpr_int32
success
);
/* Version info */
GPR_EXPORT
char
*
GPR_CALLTYPE
grpcsharp_version_string
()
{
return
grpc_version_string
();
}
/* For testing */
/* For testing */
GPR_EXPORT
void
GPR_CALLTYPE
GPR_EXPORT
void
GPR_CALLTYPE
grpcsharp_test_callback
(
test_callback_funcptr
callback
)
{
grpcsharp_test_callback
(
test_callback_funcptr
callback
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment