capture the server too

pull/19526/head
mgravell 6 years ago
parent 36ecd052f6
commit 834a3d29a6
  1. 6
      src/csharp/Grpc.Core/Server.cs

@ -334,7 +334,7 @@ namespace Grpc.Core
/// <summary>
/// Selects corresponding handler for given call and handles the call.
/// </summary>
private async Task HandleCallAsync(ServerRpcNew newRpc, CompletionQueueSafeHandle cq, Action<CompletionQueueSafeHandle> continuation)
private async Task HandleCallAsync(ServerRpcNew newRpc, CompletionQueueSafeHandle cq, Action<Server, CompletionQueueSafeHandle> continuation)
{
try
{
@ -351,7 +351,7 @@ namespace Grpc.Core
}
finally
{
continuation(cq);
continuation(this, cq);
}
}
@ -374,7 +374,7 @@ namespace Grpc.Core
// Don't await, the continuations will run on gRPC thread pool once triggered
// by cq.Next().
#pragma warning disable 4014
HandleCallAsync(newRpc, cq, state => AllowOneRpc(state));
HandleCallAsync(newRpc, cq, (server, state) => server.AllowOneRpc(state));
#pragma warning restore 4014
}
}

Loading…
Cancel
Save