Merge pull request #3086 from esdrubal/master
authormonojenkins <jo.shields+jenkins@xamarin.com>
Wed, 1 Jun 2016 16:25:11 +0000 (17:25 +0100)
committermonojenkins <jo.shields+jenkins@xamarin.com>
Wed, 1 Jun 2016 16:25:11 +0000 (17:25 +0100)
commit4e928f6338727a84ec90a135b88f3833d572a28c
tree6ad9dcf17c1750faa80d67345383f9d3fd2af68f
parentca82b187d225a98cbe959c5eee380eba25b237fb
parent069388458062a13d78eafa356f96860150d8d583
Merge pull request #3086 from esdrubal/master

[System] Fixes socket async exception.

SendAsyncFile uses StartSocketServer to start a server and at the same
time begins to accept a client socket. The issue is that when
the accept callback is called SendAsyncFile already closed the socket.

Fixed race condition by moving StartSocketServer and ReceiveCallback
logic into SendAsyncFile, and by using a new MRE to ensure that the
client receives all the data before the server is closed.

Fixes [#41264](https://bugzilla.xamarin.com/show_bug.cgi?id=41264)