Fix Socket Shutdown_TCP_CLOSED_Success test (dotnet/corefx#23975)
authorDavid Shulman <david.shulman@microsoft.com>
Tue, 12 Sep 2017 17:13:01 +0000 (13:13 -0400)
committerGitHub <noreply@github.com>
Tue, 12 Sep 2017 17:13:01 +0000 (13:13 -0400)
commit3b05b426af9b0185c2dd96353fd50f5ebbc5afc1
tree33618702a3495a5df7652778cc75679c296d17b5
parentc8fcec1e55c8189c480460f4734dea135037b47f
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