DiscoveryDefaults.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / System.ServiceModel.Discovery / System / ServiceModel / Discovery / DiscoveryDefaults.cs / 1305376 / DiscoveryDefaults.cs

                            //---------------------------------------------------------------- 
// Copyright (c) Microsoft Corporation.  All rights reserved.
//---------------------------------------------------------------
namespace System.ServiceModel.Discovery
{ 
    using System.ServiceModel.Channels;
    using System.Runtime; 
    using System.Diagnostics.CodeAnalysis; 
    using System.Globalization;
 
    static class DiscoveryDefaults
    {
        public static readonly TimeSpan DiscoveryOperationDuration = TimeSpan.Parse(DiscoveryOperationDurationString, CultureInfo.InvariantCulture);
 
        public static readonly Uri ScopeMatchBy = FindCriteria.ScopeMatchByPrefix;
        public const string DiscoveryOperationDurationString = "00:00:20"; 
        public const int DuplicateMessageHistoryLength = 2 * 1028; 

        public static class Udp 
        {
            [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes)]
            public static readonly Uri IPv4MulticastAddress = new Uri(ProtocolStrings.Udp.MulticastIPv4Address);
 
            [SuppressMessage(FxCop.Category.Security, FxCop.Rule.DoNotDeclareReadOnlyMutableReferenceTypes)]
            public static readonly Uri IPv6MulticastAddress = new Uri(ProtocolStrings.Udp.MulticastIPv6Address); 
            public static readonly TimeSpan AppMaxDelay = TimeSpan.Parse(AppMaxDelayString, CultureInfo.InvariantCulture); 

            public const string AppMaxDelayString = "00:00:00.500"; 

            public const int DuplicateMessageHistoryLength = 4 * 1028;
            public const int MaxUnicastRetransmitCount = 1;
            public const int MaxMulticastRetransmitCount = 2; 

            public static UdpTransportBindingElement CreateUdpTransportBindingElement() 
            { 
                UdpTransportBindingElement udpBE = new UdpTransportBindingElement();
                udpBE.EnableMulticast = true; 
                udpBE.RetransmissionSettings.MaxUnicastRetransmitCount = MaxUnicastRetransmitCount;
                udpBE.RetransmissionSettings.MaxMulticastRetransmitCount = MaxMulticastRetransmitCount;
                udpBE.RetransmissionSettings.DelayLowerBound = TimeSpan.FromMilliseconds(50);
                udpBE.RetransmissionSettings.DelayUpperBound = TimeSpan.FromMilliseconds(250); 
                udpBE.RetransmissionSettings.MaxDelayPerRetransmission = TimeSpan.FromMilliseconds(500);
                udpBE.DuplicateMessageHistoryLength = DuplicateMessageHistoryLength; 
 
                return udpBE;
            } 
        }
    }
}

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
                        

Link Menu

Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
This book is available now!
Buy at Amazon US or
Buy at Amazon UK