[Mono-bugs] [Bug 71753][Wis] New - System.Net.Socket.SetSocketOption accepts boolean true for SocketOptionName.KeepAlive

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Tue, 25 Jan 2005 17:52:44 -0500 (EST)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by mail@meebey.net.

http://bugzilla.ximian.com/show_bug.cgi?id=71753

--- shadow/71753	2005-01-25 17:52:44.000000000 -0500
+++ shadow/71753.tmp.6760	2005-01-25 17:52:44.000000000 -0500
@@ -0,0 +1,54 @@
+Bug#: 71753
+Product: Mono: Class Libraries
+Version: 1.1
+OS: 
+OS Details: Debian Sid/Unstable
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: mail@meebey.net               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: System.Net.Socket.SetSocketOption accepts boolean true for SocketOptionName.KeepAlive
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+When I set the KeepAlive option of a socket, mono accepts to pass true and
+it works. When I try the same code on windows with MS .NET it will fail
+with an argument exception for optionValue. According to MSDN the boolean
+options must be past as nonzero for true and zero for false.
+Passing 1 works on Mono and MS .NET
+
+Steps to reproduce the problem:
+
+using System;
+using System.Net;
+using System.Net.Sockets;
+class MainClass {
+  static void Main() {
+    IPEndPoint ep = new IPEndPoint(IPAddress.Loopback, 1);
+    Socket sock = new
+Socket(ep.Address.AddressFamily,SocketType.Stream,ProtocolType.Tcp);
+    sock.SetSocketOption(SocketOptionLevel.Socket,
+SocketOptionName.KeepAlive, true);
+  }
+}
+
+Actual Results:
+it works
+
+Expected Results:
+failing with an argument exception like MS .NET does
+
+How often does this happen? 
+always
+
+Additional Information:
+MSDN for Socket.SetSocketOption()
+http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemnetsocketssocketclasssetsocketoptiontopic2.asp