Browse Source

2006-06-28 Atsushi Enomoto <[email protected]>

	* Socket.cs : use ConfigurationManager.GetSection() under NET_2_0.
	  Also make sure to avoid NRE.


svn path=/trunk/mcs/; revision=62117
Atsushi Eno 19 years ago
parent
commit
a421054973

+ 5 - 0
mcs/class/System/System.Net.Sockets/ChangeLog

@@ -1,3 +1,8 @@
+2006-06-28  Atsushi Enomoto  <[email protected]>
+
+	* Socket.cs : use ConfigurationManager.GetSection() under NET_2_0.
+	  Also make sure to avoid NRE.
+
 2006-06-24  Zoltan Varga  <[email protected]>
 
 	* Socket.cs: Add stubs for net 2.0 SendTimeout and ReceiveTimeout properties.

+ 3 - 2
mcs/class/System/System.Net.Sockets/Socket.cs

@@ -740,8 +740,9 @@ namespace System.Net.Sockets
 			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;
+				config = (SettingsSection) System.Configuration.ConfigurationManager.GetSection ("system.net/settings");
+				if (config != null)
+					ipv6Supported = config.Ipv6.Enabled ? -1 : 0;
 #else
 				NetConfig config = (NetConfig)System.Configuration.ConfigurationSettings.GetConfig("system.net/settings");