+2002-06-24 Dick Porter <dick@ximian.com>
+
+ * Socket.cs: Make SetSocketOption cope with boolean values (they
+ are passed as objects, not the ints the runtime was expecting)
+
2002-05-17 Lawrence Pit <loz@cable.a2000.nl>
* TcpListener.cs: Renamed LocalEndPoint to LocalEndpoint
* NetworkStream.cs, UdpClient.cs and TcpClient.cs: modified disposable
throw new ArgumentNullException();
}
- SetSocketOption_internal(socket, level, name,
- opt_value, null, 0);
+ /* Passing a bool as the third parameter to
+ * SetSocketOption causes this overload to be
+ * used when in fact we want to pass the value
+ * to the runtime as an int.
+ */
+ if(opt_value is System.Boolean) {
+ bool bool_val=(bool)opt_value;
+
+ /* Stupid casting rules :-( */
+ if(bool_val==true) {
+ SetSocketOption_internal(socket, level,
+ name, null,
+ null, 1);
+ } else {
+ SetSocketOption_internal(socket, level,
+ name, null,
+ null, 0);
+ }
+ } else {
+ SetSocketOption_internal(socket, level, name,
+ opt_value, null, 0);
+ }
}
[MethodImplAttribute(MethodImplOptions.InternalCall)]