2008-06-10 Stephane Delcroix <sdelcroix@novell.com>
authorStephane Delcroix <stephane@mono-cvs.ximian.com>
Tue, 10 Jun 2008 13:52:56 +0000 (13:52 -0000)
committerStephane Delcroix <stephane@mono-cvs.ximian.com>
Tue, 10 Jun 2008 13:52:56 +0000 (13:52 -0000)
* DnsEndPoint_2_1.cs: embed an IPAddress and rely on IPEndPoint
for serialization.

svn path=/trunk/mcs/; revision=105430

mcs/class/System.Net/System.Net/ChangeLog
mcs/class/System.Net/System.Net/DnsEndPoint_2_1.cs

index 97952321fc9d3f7eab8b3c484861497de1b5cd5a..61cc4b60c0c5e2f807116963980c7e3b11cb896c 100644 (file)
@@ -1,3 +1,8 @@
+2008-06-10  Stephane Delcroix  <sdelcroix@novell.com>
+
+       * DnsEndPoint_2_1.cs: embed an IPAddress and rely on IPEndPoint
+       for serialization.
+
 2008-06-04  Stephane Delcroix  <sdelcroix@novell.com>
 
        * DnsEndPoint_2_1.cs: new DnsEndPoint class for SL2b1
index ce72f7f5c39475ed1bdc7b5a52a0cbaaf52d6d27..57c14649d4ff4de41b78f0a4430f311a4fbcb060 100644 (file)
@@ -38,6 +38,7 @@ namespace System.Net {
                string host;
                int port;
                Sockets.AddressFamily addressFamily = Sockets.AddressFamily.Unknown;
+               private IPAddress ipAddress;
 
                public DnsEndPoint (string host, int port)
                {
@@ -50,6 +51,9 @@ namespace System.Net {
 
                        this.host = host;
                        this.port = port;
+                       
+                       IPHostEntry host_entry = Dns.GetHostEntry (host);
+                       ipAddress = host_entry.AddressList[0];
                }
 
                public DnsEndPoint (string host, int port, Sockets.AddressFamily addressFamily) : this (host, port)
@@ -87,6 +91,11 @@ namespace System.Net {
                        get { return addressFamily; }
                }
 
+               public override SocketAddress Serialize ()
+               {
+                       return new IPEndPoint (ipAddress, port).Serialize ();
+               }
+
                public string Host {
                        get { return host; }
                }