Fix SocketResponder on Windows
authorNiklas Therning <niklas@therning.org>
Mon, 10 Oct 2016 14:04:49 +0000 (16:04 +0200)
committerNiklas Therning <niklas@therning.org>
Mon, 10 Oct 2016 15:06:43 +0000 (17:06 +0200)
commit9e4a4ff90ec3b7c536d4348aa21fd7ffec2a43ad
treeb767dd499db126dc24066bceecf89ac2bcd9a9b5
parent082057e3d7247ac5c260355d8145960fbaaa8e76
Fix SocketResponder on Windows

There seems to be a race in some tests in the System test suite that use
SocketResponder on Windows. Some tests fail with an exception that the socket
has been closed before they get a chance to see the response sent by the
SocketResponder. The same happens occasionally when using SocketResponder on
.NET. This patch changes the order of the Socket.Shutdown() calls and adds a
Socket.Receive() before Shutdown() is called to give the sender a chance to
actually send any data before the responder shuts down and closes its side of
the connection.
mcs/class/test-helpers/SocketResponder.cs