diff --git a/CHANGELOG.md b/CHANGELOG.md index 36cfe8f2d..71597f24e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) - Updated the Microsoft.Extensions.ObjectPool dependency from version 8.0.6 to 8.0.7 +### Fixed + +- Under some circumstances 'AuthenticateAsClientAsync' will hang after a network issue. Setting the receive and send timeouts on the TCP client should fix this + ## [3.3.1] - 2024-06-24 ### Added diff --git a/src/DotPulsar/Internal/Connector.cs b/src/DotPulsar/Internal/Connector.cs index 51be8b59e..6c8964b9d 100644 --- a/src/DotPulsar/Internal/Connector.cs +++ b/src/DotPulsar/Internal/Connector.cs @@ -62,7 +62,11 @@ public async Task Connect(Uri serviceUrl, CancellationToken cancellation private static async Task GetStream(string host, int port, CancellationToken cancellationToken) { - var tcpClient = new TcpClient(); + var tcpClient = new TcpClient + { + ReceiveTimeout = 30000, + SendTimeout = 30000 + }; try {