Explorar o código

implemented some Sys.SM.Discovery types.

atsushieno %!s(int64=15) %!d(string=hai) anos
pai
achega
ad9dcaa397
Modificáronse 15 ficheiros con 333 adicións e 35 borrados
  1. 1 1
      mcs/class/System.ServiceModel.Discovery/System.ServiceModel.Discovery.Version11/DiscoveryMessageSequence11.cs
  2. 1 1
      mcs/class/System.ServiceModel.Discovery/System.ServiceModel.Discovery.Version11/EndpointDiscoveryMetadata11.cs
  3. 1 1
      mcs/class/System.ServiceModel.Discovery/System.ServiceModel.Discovery.Version11/FindCriteria11.cs
  4. 1 1
      mcs/class/System.ServiceModel.Discovery/System.ServiceModel.Discovery.Version11/ResolveCriteria11.cs
  5. 75 0
      mcs/class/System.ServiceModel.Discovery/System.ServiceModel.Discovery.VersionCD1/DiscoveryMessageSequenceCD1.cs
  6. 70 0
      mcs/class/System.ServiceModel.Discovery/System.ServiceModel.Discovery.VersionCD1/EndpointDiscoveryMetadataCD1.cs
  7. 70 0
      mcs/class/System.ServiceModel.Discovery/System.ServiceModel.Discovery.VersionCD1/FindCriteriaCD1.cs
  8. 70 0
      mcs/class/System.ServiceModel.Discovery/System.ServiceModel.Discovery.VersionCD1/ResolveCriteriaCD1.cs
  9. 8 4
      mcs/class/System.ServiceModel.Discovery/System.ServiceModel.Discovery.dll.sources
  10. 1 1
      mcs/class/System.ServiceModel.Discovery/System.ServiceModel.Discovery/AnnouncementService.cs
  11. 5 11
      mcs/class/System.ServiceModel.Discovery/System.ServiceModel.Discovery/DiscoveryMessageSequence.cs
  12. 4 3
      mcs/class/System.ServiceModel.Discovery/System.ServiceModel.Discovery/DiscoveryMessageSequenceGenerator.cs
  13. 7 4
      mcs/class/System.ServiceModel.Discovery/System.ServiceModel.Discovery/DiscoveryVersion.cs
  14. 11 8
      mcs/class/System.ServiceModel.Discovery/System.ServiceModel.Discovery/UdpDiscoveryEndpoint.cs
  15. 8 0
      mcs/class/System.ServiceModel.Discovery/System.ServiceModel.Discovery/UdpTransportSettings.cs

+ 1 - 1
mcs/class/System.ServiceModel.Discovery/System.ServiceModel.Discovery.VersionCD1/DiscoveryMessageSequence11.cs → mcs/class/System.ServiceModel.Discovery/System.ServiceModel.Discovery.Version11/DiscoveryMessageSequence11.cs

@@ -33,7 +33,7 @@ using System.Xml;
 using System.Xml.Schema;
 using System.Xml.Serialization;
 
-namespace System.ServiceModel.Discovery.VersionCD1
+namespace System.ServiceModel.Discovery.Version11
 {
 	public class DiscoveryMessageSequence11 : IXmlSerializable
 	{

+ 1 - 1
mcs/class/System.ServiceModel.Discovery/System.ServiceModel.Discovery.VersionCD1/EndpointDiscoveryMetadata11.cs → mcs/class/System.ServiceModel.Discovery/System.ServiceModel.Discovery.Version11/EndpointDiscoveryMetadata11.cs

@@ -33,7 +33,7 @@ using System.Xml;
 using System.Xml.Schema;
 using System.Xml.Serialization;
 
-namespace System.ServiceModel.Discovery.VersionCD1
+namespace System.ServiceModel.Discovery.Version11
 {
 	public class EndpointDiscoveryMetadata11 : IXmlSerializable
 	{

+ 1 - 1
mcs/class/System.ServiceModel.Discovery/System.ServiceModel.Discovery.VersionCD1/FindCriteria11.cs → mcs/class/System.ServiceModel.Discovery/System.ServiceModel.Discovery.Version11/FindCriteria11.cs

@@ -33,7 +33,7 @@ using System.Xml;
 using System.Xml.Schema;
 using System.Xml.Serialization;
 
-namespace System.ServiceModel.Discovery.VersionCD1
+namespace System.ServiceModel.Discovery.Version11
 {
 	public class FindCriteria11 : IXmlSerializable
 	{

+ 1 - 1
mcs/class/System.ServiceModel.Discovery/System.ServiceModel.Discovery.VersionCD1/ResolveCriteria11.cs → mcs/class/System.ServiceModel.Discovery/System.ServiceModel.Discovery.Version11/ResolveCriteria11.cs

@@ -33,7 +33,7 @@ using System.Xml;
 using System.Xml.Schema;
 using System.Xml.Serialization;
 
-namespace System.ServiceModel.Discovery.VersionCD1
+namespace System.ServiceModel.Discovery.Version11
 {
 	public class ResolveCriteria11 : IXmlSerializable
 	{

+ 75 - 0
mcs/class/System.ServiceModel.Discovery/System.ServiceModel.Discovery.VersionCD1/DiscoveryMessageSequenceCD1.cs

@@ -0,0 +1,75 @@
+//
+// Author: Atsushi Enomoto <[email protected]>
+//
+// Copyright (C) 2009 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.ServiceModel;
+using System.ServiceModel.Channels;
+using System.ServiceModel.Description;
+using System.ServiceModel.Dispatcher;
+using System.Xml;
+using System.Xml.Schema;
+using System.Xml.Serialization;
+
+namespace System.ServiceModel.Discovery.VersionCD1
+{
+	public class DiscoveryMessageSequenceCD1 : IXmlSerializable
+	{
+		public static DiscoveryMessageSequenceCD1 FromDiscoveryMessageSequence (DiscoveryMessageSequence discoveryMessageSequence)
+		{
+			throw new NotImplementedException ();
+		}
+
+		public static XmlQualifiedName GetSchema (XmlSchemaSet schemaSet)
+		{
+			throw new NotImplementedException ();
+		}
+
+		internal DiscoveryMessageSequenceCD1 ()
+		{
+			throw new NotImplementedException ();
+		}
+
+		public XmlSchema GetSchema ()
+		{
+			throw new NotImplementedException ();
+		}
+
+		public void ReadXml (XmlReader reader)
+		{
+			throw new NotImplementedException ();
+		}
+
+		public DiscoveryMessageSequence ToDiscoveryMessageSequence ()
+		{
+			throw new NotImplementedException ();
+		}
+
+		public void WriteXml (XmlWriter writer)
+		{
+			throw new NotImplementedException ();
+		}
+	}
+}

+ 70 - 0
mcs/class/System.ServiceModel.Discovery/System.ServiceModel.Discovery.VersionCD1/EndpointDiscoveryMetadataCD1.cs

@@ -0,0 +1,70 @@
+//
+// Author: Atsushi Enomoto <[email protected]>
+//
+// Copyright (C) 2009 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.ServiceModel;
+using System.ServiceModel.Channels;
+using System.ServiceModel.Description;
+using System.ServiceModel.Dispatcher;
+using System.Xml;
+using System.Xml.Schema;
+using System.Xml.Serialization;
+
+namespace System.ServiceModel.Discovery.VersionCD1
+{
+	public class EndpointDiscoveryMetadataCD1 : IXmlSerializable
+	{
+		public static EndpointDiscoveryMetadataCD1 FromEndpointDiscoveryMetadata (EndpointDiscoveryMetadata endpointDiscoveryMetadata)
+		{
+			throw new NotImplementedException ();
+		}
+
+		public static XmlQualifiedName GetSchema (XmlSchemaSet schemaSet)
+		{
+			throw new NotImplementedException ();
+		}
+
+		public XmlSchema GetSchema ()
+		{
+			throw new NotImplementedException ();
+		}
+
+		public void ReadXml (XmlReader reader)
+		{
+			throw new NotImplementedException ();
+		}
+
+		public EndpointDiscoveryMetadata ToEndpointDiscoveryMetadata ()
+		{
+			throw new NotImplementedException ();
+		}
+
+		public void WriteXml (XmlWriter writer)
+		{
+			throw new NotImplementedException ();
+		}
+	}
+}

+ 70 - 0
mcs/class/System.ServiceModel.Discovery/System.ServiceModel.Discovery.VersionCD1/FindCriteriaCD1.cs

@@ -0,0 +1,70 @@
+//
+// Author: Atsushi Enomoto <[email protected]>
+//
+// Copyright (C) 2009 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.ServiceModel;
+using System.ServiceModel.Channels;
+using System.ServiceModel.Description;
+using System.ServiceModel.Dispatcher;
+using System.Xml;
+using System.Xml.Schema;
+using System.Xml.Serialization;
+
+namespace System.ServiceModel.Discovery.VersionCD1
+{
+	public class FindCriteriaCD1 : IXmlSerializable
+	{
+		public static FindCriteriaCD1 FromFindCriteria (FindCriteria findCriteria)
+		{
+			throw new NotImplementedException ();
+		}
+
+		public static XmlQualifiedName GetSchema (XmlSchemaSet schemaSet)
+		{
+			throw new NotImplementedException ();
+		}
+
+		public XmlSchema GetSchema ()
+		{
+			throw new NotImplementedException ();
+		}
+
+		public void ReadXml (XmlReader reader)
+		{
+			throw new NotImplementedException ();
+		}
+
+		public FindCriteria ToFindCriteria ()
+		{
+			throw new NotImplementedException ();
+		}
+
+		public void WriteXml (XmlWriter writer)
+		{
+			throw new NotImplementedException ();
+		}
+	}
+}

+ 70 - 0
mcs/class/System.ServiceModel.Discovery/System.ServiceModel.Discovery.VersionCD1/ResolveCriteriaCD1.cs

@@ -0,0 +1,70 @@
+//
+// Author: Atsushi Enomoto <[email protected]>
+//
+// Copyright (C) 2009 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.ServiceModel;
+using System.ServiceModel.Channels;
+using System.ServiceModel.Description;
+using System.ServiceModel.Dispatcher;
+using System.Xml;
+using System.Xml.Schema;
+using System.Xml.Serialization;
+
+namespace System.ServiceModel.Discovery.VersionCD1
+{
+	public class ResolveCriteriaCD1 : IXmlSerializable
+	{
+		public static ResolveCriteriaCD1 FromResolveCriteria (ResolveCriteria resolveCriteria)
+		{
+			throw new NotImplementedException ();
+		}
+
+		public static XmlQualifiedName GetSchema (XmlSchemaSet schemaSet)
+		{
+			throw new NotImplementedException ();
+		}
+
+		public XmlSchema GetSchema ()
+		{
+			throw new NotImplementedException ();
+		}
+
+		public void ReadXml (XmlReader reader)
+		{
+			throw new NotImplementedException ();
+		}
+
+		public ResolveCriteria ToResolveCriteria ()
+		{
+			throw new NotImplementedException ();
+		}
+
+		public void WriteXml (XmlWriter writer)
+		{
+			throw new NotImplementedException ();
+		}
+	}
+}

+ 8 - 4
mcs/class/System.ServiceModel.Discovery/System.ServiceModel.Discovery.dll.sources

@@ -24,14 +24,18 @@ System.ServiceModel.Discovery.Configuration/UdpAnnouncementEndpointElement.cs
 System.ServiceModel.Discovery.Configuration/UdpDiscoveryEndpointCollectionElement.cs
 System.ServiceModel.Discovery.Configuration/UdpDiscoveryEndpointElement.cs
 System.ServiceModel.Discovery.Configuration/UdpTransportSettingsElement.cs
+System.ServiceModel.Discovery.Version11/DiscoveryMessageSequence11.cs
+System.ServiceModel.Discovery.Version11/EndpointDiscoveryMetadata11.cs
+System.ServiceModel.Discovery.Version11/FindCriteria11.cs
+System.ServiceModel.Discovery.Version11/ResolveCriteria11.cs
 System.ServiceModel.Discovery.VersionApril2005/DiscoveryMessageSequenceApril2005.cs
 System.ServiceModel.Discovery.VersionApril2005/EndpointDiscoveryMetadataApril2005.cs
 System.ServiceModel.Discovery.VersionApril2005/FindCriteriaApril2005.cs
 System.ServiceModel.Discovery.VersionApril2005/ResolveCriteriaApril2005.cs
-System.ServiceModel.Discovery.VersionCD1/DiscoveryMessageSequence11.cs
-System.ServiceModel.Discovery.VersionCD1/EndpointDiscoveryMetadata11.cs
-System.ServiceModel.Discovery.VersionCD1/FindCriteria11.cs
-System.ServiceModel.Discovery.VersionCD1/ResolveCriteria11.cs
+System.ServiceModel.Discovery.VersionCD1/DiscoveryMessageSequenceCD1.cs
+System.ServiceModel.Discovery.VersionCD1/EndpointDiscoveryMetadataCD1.cs
+System.ServiceModel.Discovery.VersionCD1/FindCriteriaCD1.cs
+System.ServiceModel.Discovery.VersionCD1/ResolveCriteriaCD1.cs
 System.ServiceModel.Discovery/AnnouncementClient.cs
 System.ServiceModel.Discovery/AnnouncementEndpoint.cs
 System.ServiceModel.Discovery/AnnouncementEventArgs.cs

+ 1 - 1
mcs/class/System.ServiceModel.Discovery/System.ServiceModel.Discovery/AnnouncementService.cs

@@ -8,11 +8,11 @@ using System.ServiceModel.Dispatcher;
 
 namespace System.ServiceModel.Discovery
 {
-	[MonoTODO]
 	[ServiceBehavior (InstanceContextMode = InstanceContextMode.Single, ConcurrencyMode = ConcurrencyMode.Multiple)]
 	public class AnnouncementService
 	{
 		public AnnouncementService ()
+			: this (0)
 		{
 		}
 

+ 5 - 11
mcs/class/System.ServiceModel.Discovery/System.ServiceModel.Discovery/DiscoveryMessageSequence.cs

@@ -45,18 +45,14 @@ namespace System.ServiceModel.Discovery
 		public long MessageNumber { get; private set; }
 		public Uri SequenceId { get; private set; }
 
-		[MonoTODO]
 		public bool CanCompareTo (DiscoveryMessageSequence other)
 		{
-			if (other == null)
-				return false;
-			return InstanceId == other.InstanceId && SequenceId.Equals (other.SequenceId);
+			return other != null; // I cannot find any other conditions that return false.
 		}
 
-		[MonoTODO]
 		public int CompareTo (DiscoveryMessageSequence other)
 		{
-			throw new NotImplementedException ();
+			return CanCompareTo (other) ? GetHashCode () - other.GetHashCode () : -1;
 		}
 
 		public bool Equals (DiscoveryMessageSequence other)
@@ -64,7 +60,7 @@ namespace System.ServiceModel.Discovery
 			if (other == null)
 				return false;
 			return  InstanceId == other.InstanceId &&
-				SequenceId.Equals (other.SequenceId) &&
+				(SequenceId == null && other.SequenceId == null || SequenceId.Equals (other.SequenceId)) &&
 				MessageNumber == other.MessageNumber;
 		}
 
@@ -74,16 +70,14 @@ namespace System.ServiceModel.Discovery
 			return s != null && Equals (s);
 		}
 
-		[MonoTODO]
 		public override int GetHashCode ()
 		{
-			throw new NotImplementedException ();
+			return (int) ((InstanceId * (SequenceId != null ? SequenceId.GetHashCode () : 1) << 17) + MessageNumber);
 		}
 
-		[MonoTODO]
 		public override string ToString ()
 		{
-			throw new NotImplementedException ();
+			return String.Format ("InstanceId={0}, SequenceId={1}, MessageNumber={2}", InstanceId, SequenceId, MessageNumber);
 		}
 
 		public static bool operator == (DiscoveryMessageSequence messageSequence1, DiscoveryMessageSequence messageSequence2)

+ 4 - 3
mcs/class/System.ServiceModel.Discovery/System.ServiceModel.Discovery/DiscoveryMessageSequenceGenerator.cs

@@ -34,8 +34,10 @@ namespace System.ServiceModel.Discovery
 {
 	public class DiscoveryMessageSequenceGenerator
 	{
-		[MonoTODO ("default values?")]
+		static readonly Random rnd = new Random ();
+
 		public DiscoveryMessageSequenceGenerator ()
+			: this (AppDomain.CurrentDomain.Id, null) // not sure what should be used for instanceId; multiple instances share the same Id
 		{
 		}
 
@@ -48,10 +50,9 @@ namespace System.ServiceModel.Discovery
 		long instance_id, message_count;
 		Uri sequence_id;
 
-		[MonoTODO ("default number?")]
 		public DiscoveryMessageSequence Next ()
 		{
-			return new DiscoveryMessageSequence (instance_id, sequence_id, message_count++);
+			return new DiscoveryMessageSequence (instance_id, sequence_id, ++message_count);
 		}
 	}
 }

+ 7 - 4
mcs/class/System.ServiceModel.Discovery/System.ServiceModel.Discovery/DiscoveryVersion.cs

@@ -36,9 +36,9 @@ namespace System.ServiceModel.Discovery
 	{
 		static DiscoveryVersion ()
 		{
-			v11 = new DiscoveryVersion ("WSDiscovery11");
-			april2005 = new DiscoveryVersion ("WSDiscoveryApril2005");
-			cd1 = new DiscoveryVersion ("WSDiscoveryCD1");
+			v11 = new DiscoveryVersion ("WSDiscovery11", "http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01", "urn:docs-oasis-open-org:ws-dd:ns:discovery:2009:01", MessageVersion.Soap12WSAddressing10);
+			april2005 = new DiscoveryVersion ("WSDiscoveryApril2005", "http://schemas.xmlsoap.org/ws/2005/04/discovery", "urn:schemas-xmlsoap-org:ws:2005:04:discovery", MessageVersion.Soap12WSAddressingAugust2004);
+			cd1 = new DiscoveryVersion ("WSDiscoveryCD1", "http://docs.oasis-open.org/ws-dd/ns/discovery/2008/09", "urn:docs-oasis-open-org:ws-dd:discovery:2008:09", MessageVersion.Soap12WSAddressingAugust2004);
 		}
 
 		static readonly DiscoveryVersion v11, april2005, cd1;
@@ -71,9 +71,12 @@ namespace System.ServiceModel.Discovery
 			}
 		}
 
-		internal DiscoveryVersion (string name)
+		internal DiscoveryVersion (string name, string ns, string adhoc, MessageVersion version)
 		{
 			this.Name = name;
+			this.Namespace = ns;
+			AdhocAddress = new Uri (adhoc);
+			MessageVersion = version;
 		}
 
 		public Uri AdhocAddress { get; private set; }

+ 11 - 8
mcs/class/System.ServiceModel.Discovery/System.ServiceModel.Discovery/UdpDiscoveryEndpoint.cs

@@ -25,6 +25,7 @@
 using System;
 using System.Collections.Generic;
 using System.Collections.ObjectModel;
+using System.Net.NetworkInformation;
 using System.ServiceModel;
 using System.ServiceModel.Channels;
 using System.ServiceModel.Description;
@@ -34,22 +35,23 @@ namespace System.ServiceModel.Discovery
 {
 	public class UdpDiscoveryEndpoint : DiscoveryEndpoint
 	{
-		[MonoTODO]
-		public static readonly Uri DefaultIPv4MulticastAddress;
-		[MonoTODO]
-		public static readonly Uri DefaultIPv6MulticastAddress;
+		public static readonly Uri DefaultIPv4MulticastAddress = new Uri ("soap.udp://239.255.255.250:3702/");
+		public static readonly Uri DefaultIPv6MulticastAddress = new Uri ("soap.udp://[FF02:0000:0000:0000:0000:0000:0000:000C]:3702/");
 
+		internal static Uri DefaultAddress {
+			get { return IPGlobalProperties.GetIPGlobalProperties ().GetIPv4GlobalStatistics ().NumberOfInterfaces == 0 ? DefaultIPv6MulticastAddress : DefaultIPv4MulticastAddress; }
+		}
+		
 		// (1)->(2)
 		public UdpDiscoveryEndpoint ()
 			: this (DiscoveryVersion.WSDiscovery11)
 		{
 		}
 
-		// (2), everything falls to here.
+		// (2)->(6)
 		public UdpDiscoveryEndpoint (DiscoveryVersion discoveryVersion)
-			: base (discoveryVersion, ServiceDiscoveryMode.Adhoc)
+			: this (discoveryVersion, DefaultIPv4MulticastAddress)
 		{
-			TransportSettings = new UdpTransportSettings ();
 		}
 
 		// (3)->(4)
@@ -70,10 +72,11 @@ namespace System.ServiceModel.Discovery
 		{
 		}
 
-		// (6)->(2)
+		// (6), everything falls to here.
 		public UdpDiscoveryEndpoint (DiscoveryVersion discoveryVersion, Uri multicastAddress)
 			: this (discoveryVersion)
 		{
+			TransportSettings = new UdpTransportSettings ();
 			MulticastAddress = multicastAddress;
 		}
 

+ 8 - 0
mcs/class/System.ServiceModel.Discovery/System.ServiceModel.Discovery/UdpTransportSettings.cs

@@ -36,6 +36,14 @@ namespace System.ServiceModel.Discovery
 	{
 		internal UdpTransportSettings ()
 		{
+			DuplicateMessageHistoryLength = 4112;
+			MaxBufferPoolSize = 0x80000;
+			MaxMulticastRetransmitCount = 2;
+			MaxPendingMessageCount = 32;
+			MaxReceivedMessageSize = 0xFFE7;
+			MaxUnicastRetransmitCount = 1;
+			SocketReceiveBufferSize = 0x10000;
+			TimeToLive = 1;
 		}
 
 		public int DuplicateMessageHistoryLength { get; set; }