Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1059,6 +1059,7 @@ await RetryHelper.ExecuteAsync(async () =>
(Socket socket1, Socket socket2) = SocketTestExtensions.CreateConnectedSocketPair(ipv6Server, dualModeClient);
using SafeSocketHandle? owner = ReplaceWithNonOwning(ref socket1, owning);

using (socket1)
using (socket2)
{
Task socketOperation;
Expand Down Expand Up @@ -1138,6 +1139,15 @@ await socketOperation
peerSocketError = se.SocketErrorCode;
break;
}
catch (TimeoutException ex) when (!receiveOrSend && (PlatformDetection.IsApplePlatform || PlatformDetection.IsFreeBSD))
{
// BSD TCP stacks may reject a valid reset when sent data has not yet
// been acknowledged. Retry with fresh sockets, not another receive.
const string Message = "Timed out waiting for the peer to observe the connection reset, retry.";
_output?.WriteLine(Message);
_output?.WriteLine(ex.ToString());
Assert.Fail(Message);
}
}

try
Expand Down
Loading