From 3b05b426af9b0185c2dd96353fd50f5ebbc5afc1 Mon Sep 17 00:00:00 2001 From: David Shulman Date: Tue, 12 Sep 2017 13:13:01 -0400 Subject: [PATCH] Fix Socket Shutdown_TCP_CLOSED_Success test (dotnet/corefx#23975) This test has been failing at times with an exception being generated from the client socket due to the loopback server terminating the connection with RST instead of FIN. The problem is that the server socket needs to use Shutdown() before Dispose() to ensure a clean FIN after the data gets sent back to the client. Fixes dotnet/corefx#13539 Commit migrated from https://github.com/dotnet/corefx/commit/338ddc649308c7e3b97a37c8803a1cc5e5e3bd59 --- src/libraries/System.Net.Sockets/tests/FunctionalTests/Shutdown.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/Shutdown.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/Shutdown.cs index d567397..1a15b23 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/Shutdown.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/Shutdown.cs @@ -42,6 +42,7 @@ namespace System.Net.Sockets.Tests var client = (Socket)args.UserToken; if (args.BytesTransferred == 0) { + client.Shutdown(SocketShutdown.Send); client.Dispose(); break; } -- 2.7.4