Skip to content

Commit 006afe0

Browse files
arialdomartiniJamesNK
authored andcommitted
gRPC Channel is disposed of after use (#16432)
1 parent d955f05 commit 006afe0

File tree

1 file changed

+1
-1
lines changed
  • aspnetcore/tutorials/grpc/grpc-start/sample/GrpcGreeterClient

1 file changed

+1
-1
lines changed

aspnetcore/tutorials/grpc/grpc-start/sample/GrpcGreeterClient/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Program
1313
static async Task Main(string[] args)
1414
{
1515
// The port number(5001) must match the port of the gRPC server.
16-
var channel = GrpcChannel.ForAddress("https://localhost:5001");
16+
using var channel = GrpcChannel.ForAddress("https://localhost:5001");
1717
var client = new Greeter.GreeterClient(channel);
1818
var reply = await client.SayHelloAsync(
1919
new HelloRequest { Name = "GreeterClient" });

0 commit comments

Comments
 (0)