From: Manuel de la Pena Date: Fri, 8 Sep 2017 11:05:48 +0000 (+0200) Subject: [Tests] Fix Mono.Data.Tds tests on iOS (#5501) X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=mono.git;a=commitdiff_plain;h=a09b912b86e0d488f13d6c1b0b2276e94e0f9499 [Tests] Fix Mono.Data.Tds tests on iOS (#5501) * [Tests] Fix Mono.Data.Tds tests on iOS The modified tests failed on iOS following PR: https://github.com/xamarin/xamarin-macios/pull/2580 that adds support for Xharness to run the Mono.Data.Tds on Xamarin.iOS. With the changes the tests run a expected. * Close Listener when done. --- diff --git a/mcs/class/Mono.Data.Tds/Test/bug-4786.cs b/mcs/class/Mono.Data.Tds/Test/bug-4786.cs index 91f8a06fc1a..ed44567b40d 100644 --- a/mcs/class/Mono.Data.Tds/Test/bug-4786.cs +++ b/mcs/class/Mono.Data.Tds/Test/bug-4786.cs @@ -51,13 +51,10 @@ namespace MonoTests.Mono.Data.Tds //require at this point: a listener on port 1433... try{ - Socket Listener = new Socket(AddressFamily.InterNetwork, - SocketType.Stream, - ProtocolType.Tcp); IPAddress hostIP =Dns.GetHostEntry("localhost").AddressList[0]; - IPEndPoint ep = new IPEndPoint(hostIP, 1433); - Listener.Bind(ep); - Listener.Listen(1); + IPEndPoint ep = new IPEndPoint(hostIP, 1433); + TcpListener Listener = new TcpListener (ep); + Listener.Start (); } catch (Exception){ //ignore } @@ -103,6 +100,7 @@ namespace MonoTests.Mono.Data.Tds pool.ReleaseConnection(tds); + Listener.Stop (); //exit } }