aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/csharp/Grpc.Core/Server.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/csharp/Grpc.Core/Server.cs')
-rw-r--r--src/csharp/Grpc.Core/Server.cs12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/csharp/Grpc.Core/Server.cs b/src/csharp/Grpc.Core/Server.cs
index 152cc2176c..cafdb3b663 100644
--- a/src/csharp/Grpc.Core/Server.cs
+++ b/src/csharp/Grpc.Core/Server.cs
@@ -75,10 +75,20 @@ namespace Grpc.Core
}
// only call before Start()
- public int AddPort(string addr) {
+ public int AddPort(string addr)
+ {
return handle.AddPort(addr);
}
+ // only call before Start()
+ public int AddPort(string addr, ServerCredentials credentials)
+ {
+ using (var nativeCredentials = credentials.ToNativeCredentials())
+ {
+ return handle.AddPort(addr, nativeCredentials);
+ }
+ }
+
public void Start()
{
handle.Start();