[Mono-bugs] [Bug 58373][Cri] New - Problems getting Socket options
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Wed, 12 May 2004 07:51:10 -0400 (EDT)
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 giuseppe.greco@agamura.com.
http://bugzilla.ximian.com/show_bug.cgi?id=58373
--- shadow/58373 2004-05-12 07:51:10.000000000 -0400
+++ shadow/58373.tmp.3463 2004-05-12 07:51:10.000000000 -0400
@@ -0,0 +1,78 @@
+Bug#: 58373
+Product: Mono: Class Libraries
+Version: unspecified
+OS: other
+OS Details: Fedora Core 1
+Status: NEW
+Resolution:
+Severity:
+Priority: Critical
+Component: System
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: giuseppe.greco@agamura.com
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: Problems getting Socket options
+
+Description of Problem:
+The Socket.GetSocketOption() method throws a
+System.NullReferenceException when there are
+attempts to get socket options like Broadcast
+or ReceiveBuffer.
+
+Steps to reproduce the problem:
+1. Write a small program like this:
+
+ using System;
+ using System.Net;
+ using System.Net.Sockets;
+
+ public class MyApp
+ {
+ public static void Main()
+ {
+ Socket socket = new Socket(
+ AddressFamily.InterNetwork,
+ SocketType.Raw,
+ ProtocolType.Udp);
+
+ IPEndPoint endPoint = new IPEndPoint(IPAddress.Loopback, 9000);
+ socket.Bind(localEndPoint);
+
+ int broadcast = (int) socket.GetSocketOption(
+ SocketOptionLevel.Socket,
+ SocketOptionName.Broadcast);
+
+ int bufferSize = (int) socket.GetSocketOption(
+ SocketOptionLevel.Socket,
+ SocketOptionName.ReceiveBuffer);
+ }
+ }
+
+2. Compile and run it as superuser
+
+
+Actual Results:
+The Socket.GetSocketOption() method always throws the
+following exception:
+
+Unhandled Exception: System.NullReferenceException: A null value was found
+where an object instance was required.
+in (unmanaged) /usrlocal/lib/libmono.so.0 [0xe49431]
+in (unmanaged) /usr/local/lib/libmono.so.0 [0xe49506]
+in <0x0002b> System.Net.Sockets.Socket:GetSocketOption
+(System.Net.Sockets.SocketOptionLevel,System.Net.Sockets.SocketOptionName)
+in <0x0011b> Sender:Main ()
+
+
+Expected Results:
+The Socket.GetSocketOption() method should return the requested
+socket option.
+
+How often does this happen?
+Always.
+
+Additional Information:
+This works with .NET on Windows.