NamedPipeActivation.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / SMSvcHost / System / ServiceModel / Activation / NamedPipeActivation.cs / 1 / NamedPipeActivation.cs

                            //------------------------------------------------------------------------------ 
// Copyright (c) Microsoft Corporation.  All rights reserved.
//-----------------------------------------------------------------------------

namespace System.ServiceModel.Activation 
{
    using System; 
    using System.ServiceModel.Channels; 
    using System.Diagnostics;
    using System.ServiceModel.Activation.Diagnostics; 
    using System.ServiceModel.Diagnostics;

    class NamedPipeActivation : ActivationService
    { 
        NamedPipeSharing serviceCore;
 
        internal NamedPipeActivation() 
            : base(ListenerConstants.NamedPipeActivationServiceName, Uri.UriSchemeNetPipe)
        { 
            serviceCore = new NamedPipeSharing();
        }

        protected override void OnContinue() 
        {
            base.OnContinue(); 
            serviceCore.OnContinue(); 
        }
 
#if DEBUG
        protected override void OnCustomCommand(int command)
        {
            serviceCore.OnCustomCommand(command); 
        }
#endif 
 
        protected override void OnPause()
        { 
            base.OnPause();
            serviceCore.OnPause();
        }
 
        protected override void OnShutdown()
        { 
            base.OnShutdown(); 
            base.RequestAdditionalTime(ListenerConstants.ServiceStopTimeout);
            serviceCore.OnShutdown(); 
        }

        protected override void OnStart(string[] args)
        { 
            try
            { 
                ListenerConfig.EnsureInitializedForNetPipe(); 

                base.OnStart(args); 
                // we don't support delay starting the sharing piece for named pipes
                serviceCore.Start();
            }
            catch (Exception exception) 
            {
                // Log the error to eventlog. 
                ListenerTraceUtility.EventLog.LogEvent(TraceEventType.Error, 
                    EventLogCategory.ListenerAdapter,
                    EventLogEventId.ServiceStartFailed, 
                    false,
                    exception.ToString());

                throw; 
            }
        } 
 
        protected override void OnStop()
        { 
            base.OnStop();
            base.RequestAdditionalTime(ListenerConstants.ServiceStopTimeout);
            serviceCore.OnStop();
        } 

        class NamedPipeSharing : SharingService 
        { 
            internal NamedPipeSharing()
                : base(TransportType.NamedPipe, ListenerConstants.NamedPipeActivationServiceName, ListenerConstants.NamedPipeSharedMemoryName) 
            {
            }
        }
    } 
}
 

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
                        

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