Skip to content

Commit

Permalink
feat: improve client
Browse files Browse the repository at this point in the history
  • Loading branch information
josephnhtam committed Sep 15, 2024
1 parent 40fac01 commit 8167bf9
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/LiveStreamingServerNet.Networking/Internal/Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,18 @@ public async Task RunAsync(CancellationToken stoppingToken)
{
_logger.ClientLoopError(ClientId, ex);
}
finally
{
linkedCts.Cancel();

linkedCts.Cancel();

await DisposeAsync(handler);
await DisposeAsync(_bufferSender);
await DisposeAsync(networkStream);
CloseTcpClient();
await DisposeAsync(handler);
await DisposeAsync(_bufferSender);
await DisposeAsync(networkStream);
CloseTcpClient();

_stoppedTcs.TrySetResult();
_logger.ClientDisconnected(ClientId);
_stoppedTcs.TrySetResult();
_logger.ClientDisconnected(ClientId);
}
}

private IClientHandler CreateClientHandler()
Expand Down

0 comments on commit 8167bf9

Please sign in to comment.