List:Commits« Previous MessageNext Message »
From:rburnett Date:February 20 2007 9:49pm
Subject:Connector/NET commit: r598 - in branches/5.0: . Driver/Source/common
View as plain text  
Modified:
   branches/5.0/CHANGES
   branches/5.0/Driver/Source/common/StreamCreator.cs
Log:
Bug #26152 Opening a connection is really slow 

Added code to attempt parsing the server name as an IP address before we engage a DNS
server.

Modified: branches/5.0/CHANGES
===================================================================
--- branches/5.0/CHANGES	2007-02-20 20:34:53 UTC (rev 597)
+++ branches/5.0/CHANGES	2007-02-20 20:49:34 UTC (rev 598)
@@ -17,6 +17,7 @@
   Bug #25950 DataSourceInformation collection contains incorrect values 
   Bug #26430 Will not install under Vista   
   Bug #25605 BINARY and VARBINARY is returned as a string 
+  Bug #26152 Opening a connection is really slow 
 
   Other changes
   -------------

Modified: branches/5.0/Driver/Source/common/StreamCreator.cs
===================================================================
--- branches/5.0/Driver/Source/common/StreamCreator.cs	2007-02-20 20:34:53 UTC (rev 597)
+++ branches/5.0/Driver/Source/common/StreamCreator.cs	2007-02-20 20:49:34 UTC (rev 598)
@@ -70,7 +70,7 @@
 				else
 				{
 #if NET20
-					IPHostEntry ipHE = Dns.GetHostEntry(dnsHosts[index]);
+                    IPHostEntry ipHE = GetHostEntry(dnsHosts[index]);
 #else
 				    IPHostEntry ipHE = Dns.GetHostByName(dnsHosts[index]);
 #endif
@@ -97,6 +97,21 @@
 			return stream;
 		}
 
+        private IPHostEntry GetHostEntry(string hostname)
+        {
+            IPAddress addr = null;
+            IPHostEntry ipHE;
+            if (IPAddress.TryParse(hostname, out addr))
+            {
+                ipHE = new IPHostEntry();
+                ipHE.AddressList = new IPAddress[1];
+                ipHE.AddressList[0] = addr;
+            }
+            else
+                ipHE = Dns.GetHostEntry(hostname);
+            return ipHE;
+        }
+
 		private Stream CreateNamedPipeStream(string hostname)
 		{
 			string pipePath;

Thread
Connector/NET commit: r598 - in branches/5.0: . Driver/Source/commonrburnett20 Feb