Skip to content

Commit 524bade

Browse files
authored
fix: Remove KeepAlive socket option (#1671)
1 parent 598f961 commit 524bade

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/Testcontainers/Containers/ResourceReaper.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,8 @@ await Task.Delay(TimeSpan.FromSeconds(RetryTimeoutInSeconds), CancellationToken.
304304

305305
using (var tcpClient = new TcpClient())
306306
{
307-
tcpClient.Client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.KeepAlive, true);
307+
// On some plateform the connection fail with PlatformNotSupportedException: Sockets on this platform are invalid for use after a failed connection attempt.
308+
// tcpClient.Client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.KeepAlive, true);
308309
tcpClient.LingerState = DiscardAllPendingData;
309310

310311
try

0 commit comments

Comments
 (0)