diff --git a/Haproxy.AgentCheck/Endpoints/TcpHandler.cs b/Haproxy.AgentCheck/Endpoints/TcpHandler.cs index d001b6b..4c90534 100644 --- a/Haproxy.AgentCheck/Endpoints/TcpHandler.cs +++ b/Haproxy.AgentCheck/Endpoints/TcpHandler.cs @@ -25,6 +25,9 @@ public override async Task OnConnectedAsync(ConnectionContext connection) await connection.Transport.Output.WriteAsync(Encoding.ASCII.GetBytes($"{state.Weight:F0}% {up}\n").AsMemory(), connection.ConnectionClosed); await connection.Transport.Output.FlushAsync(connection.ConnectionClosed); + + await connection.Transport.Output.CompleteAsync(); + await connection.Transport.Input.CompleteAsync(); } catch (TaskCanceledException) when (connection.ConnectionClosed.IsCancellationRequested) {