Author: gonzalo
Date: 2006-01-19 20:17:30 -0500 (Thu, 19 Jan 2006)
New Revision: 55806
Modified:
trunk/mcs/class/System/System.Net.Sockets/ChangeLog
trunk/mcs/class/System/System.Net.Sockets/Socket.cs
Log:
2006-01-19 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
* Socket.cs: use the 2.0 configuration classes when checking for IPv6
support.
Modified: trunk/mcs/class/System/System.Net.Sockets/ChangeLog
===================================================================
--- trunk/mcs/class/System/System.Net.Sockets/ChangeLog 2006-01-20 00:47:59 UTC
(rev 55805)
+++ trunk/mcs/class/System/System.Net.Sockets/ChangeLog 2006-01-20 01:17:30 UTC
(rev 55806)
@@ -1,3 +1,8 @@
+2006-01-19 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
+
+ * Socket.cs: use the 2.0 configuration classes when checking for IPv6
+ support.
+
2006-01-04 Sebastien Pouliot <[EMAIL PROTECTED]>
* TcpClient.cs: The Client property is public in 2.0 while it was
Modified: trunk/mcs/class/System/System.Net.Sockets/Socket.cs
===================================================================
--- trunk/mcs/class/System/System.Net.Sockets/Socket.cs 2006-01-20 00:47:59 UTC
(rev 55805)
+++ trunk/mcs/class/System/System.Net.Sockets/Socket.cs 2006-01-20 01:17:30 UTC
(rev 55806)
@@ -39,6 +39,7 @@
using System.Threading;
using System.Reflection;
using System.IO;
+using System.Net.Configuration;
namespace System.Net.Sockets
{
@@ -686,7 +687,6 @@
}
}
-#if NET_1_1
public static bool SupportsIPv4 {
get {
CheckProtocolSupport();
@@ -700,24 +700,7 @@
return ipv6Supported == 1;
}
}
-#else
- internal static bool SupportsIPv4
- {
- get
- {
- return true;
- }
- }
- internal static bool SupportsIPv6
- {
- get
- {
- return false;
- }
- }
-#endif
-
internal static void CheckProtocolSupport()
{
if(ipv4Supported == -1) {
@@ -733,11 +716,16 @@
}
if(ipv6Supported == -1) {
+#if NET_2_0 && CONFIGURATION_DEP
+ SettingsSection config;
+ config = (SettingsSection)
System.Configuration.ConfigurationSettings.GetConfig("system.net/settings");
+ ipv6Supported = config.Ipv6.Enabled ? -1 : 0;
+#else
NetConfig config =
(NetConfig)System.Configuration.ConfigurationSettings.GetConfig("system.net/settings");
if(config != null)
ipv6Supported = config.ipv6Enabled?-1:0;
-
+#endif
if(ipv6Supported != 0) {
try {
Socket tmp = new
Socket(AddressFamily.InterNetworkV6, SocketType.Stream, ProtocolType.Tcp);
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches