We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0dcc8fc commit ec26910Copy full SHA for ec26910
1 file changed
src/SkyApm.Transport.Grpc/ConnectionManager.cs
@@ -67,7 +67,7 @@ public async Task ConnectAsync()
67
//https://docs.microsoft.com/en-us/aspnet/core/grpc/troubleshoot?view=aspnetcore-3.0#call-insecure-grpc-services-with-net-core-client-2
68
AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true);
69
70
- _channel = GrpcChannel.ForAddress(_server);
+ _channel = GrpcChannel.ForAddress(_server, new GrpcChannelOptions { DisposeHttpClient = true });
71
_state = ConnectionState.Connected;
72
_logger.Information($"Connected server[{_channel.Target}].");
73
}
@@ -97,6 +97,7 @@ public async Task ShutdownAsync()
97
98
finally
99
{
100
+ _channel?.Dispose();
101
_state = ConnectionState.Failure;
102
103
0 commit comments