diff options
Diffstat (limited to 'mcs')
-rw-r--r-- | mcs/class/System/Test/System.Net.Sockets/ChangeLog | 4 | ||||
-rw-r--r-- | mcs/class/System/Test/System.Net.Sockets/SocketTest.cs | 20 |
2 files changed, 23 insertions, 1 deletions
diff --git a/mcs/class/System/Test/System.Net.Sockets/ChangeLog b/mcs/class/System/Test/System.Net.Sockets/ChangeLog index f07b59f14f2..a28487aecef 100644 --- a/mcs/class/System/Test/System.Net.Sockets/ChangeLog +++ b/mcs/class/System/Test/System.Net.Sockets/ChangeLog @@ -1,3 +1,7 @@ +2009-06-26 Gonzalo Paniagua Javier <gonzalo@novell.com> + + * SocketTest.cs: tests for DontLinger. + 2009-06-26 Robert Jordan <robertj@gmx.net> * *.cs: Upgrade to new NUnit style. diff --git a/mcs/class/System/Test/System.Net.Sockets/SocketTest.cs b/mcs/class/System/Test/System.Net.Sockets/SocketTest.cs index 4fb22a6d486..20ca9ce0f14 100644 --- a/mcs/class/System/Test/System.Net.Sockets/SocketTest.cs +++ b/mcs/class/System/Test/System.Net.Sockets/SocketTest.cs @@ -55,7 +55,7 @@ namespace MonoTests.System.Net.Sockets } [Test] - [Ignore ("Bug #75158")] + [Ignore ("Bug #75158")] // Looks like MS fails after the .ctor, when you try to use the socket public void IncompatibleAddress () { IPEndPoint epIPv6 = new IPEndPoint (IPAddress.IPv6Any, @@ -2749,6 +2749,24 @@ namespace MonoTests.System.Net.Sockets } } #endif + [Test] + public void LingerOptions () + { + using (Socket s = new Socket (AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)) { + s.SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.DontLinger, false); + s.SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.DontLinger, 0); + s.SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.DontLinger, new LingerOption (true, 1000)); + } + } + + [Test] + [ExpectedException (typeof (SocketException))] + public void NullLingerOption () + { + using (Socket s = new Socket (AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)) { + s.SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.DontLinger, null); + } + } } } |