Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / SMSvcHost / System / ServiceModel / Activation / TcpPortSharing.cs / 1 / TcpPortSharing.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.ServiceModel.Activation { using System.ServiceProcess; using System.Threading; using System.ServiceModel.Activation.Diagnostics; using System.Diagnostics; using System.ServiceModel.Diagnostics; class TcpPortSharing : ServiceBase { TcpPortSharingCore serviceCore; internal TcpPortSharing() : base() { this.serviceCore = new TcpPortSharingCore(); this.ServiceName = ListenerConstants.TcpPortSharingServiceName; this.CanPauseAndContinue = true; this.CanHandlePowerEvent = SharingService.CanHandlePowerEvent; this.AutoLog = SharingService.AutoLog; this.CanStop = SharingService.CanStop; this.CanShutdown = SharingService.CanShutdown; } internal bool IsPaused { get { return serviceCore.IsPaused; } } protected override void OnContinue() { if (DiagnosticUtility.ShouldTraceInformation) { ListenerTraceUtility.TraceEvent(TraceEventType.Information, TraceCode.ServiceContinue, this); } serviceCore.OnContinue(); } #if DEBUG protected override void OnCustomCommand(int command) { serviceCore.OnCustomCommand(command); } #endif protected override void OnPause() { if (DiagnosticUtility.ShouldTraceInformation) { ListenerTraceUtility.TraceEvent(TraceEventType.Information, TraceCode.ServicePause, this); } serviceCore.OnPause(); } protected override void OnShutdown() { if (DiagnosticUtility.ShouldTraceInformation) { ListenerTraceUtility.TraceEvent(TraceEventType.Information, TraceCode.ServiceShutdown, this); } base.RequestAdditionalTime(ListenerConstants.ServiceStopTimeout); serviceCore.OnShutdown(); Stop(); } protected override void OnStart(string[] args) { try { if (DiagnosticUtility.ShouldTraceInformation) { ListenerTraceUtility.TraceEvent(TraceEventType.Information, TraceCode.ServiceStart, this); } ListenerConfig.EnsureInitializedForNetTcp(); #if DEBUG if (DebuggableService.DelayStart(ServiceName)) { (new Thread(new ThreadStart(Start))).Start(); return; } #endif Start(); } catch (Exception exception) { // Log the error to eventlog. ListenerTraceUtility.EventLog.LogEvent(TraceEventType.Error, System.ServiceModel.Diagnostics.EventLogCategory.SharingService, System.ServiceModel.Diagnostics.EventLogEventId.ServiceStartFailed, false, exception.ToString()); throw; } } void Start() { #if DEBUG DebuggableService.WaitForDebugger(ServiceName); #endif serviceCore.Start(); } protected override void OnStop() { if (DiagnosticUtility.ShouldTraceInformation) { ListenerTraceUtility.TraceEvent(TraceEventType.Information, TraceCode.ServiceStop, this); } base.RequestAdditionalTime(ListenerConstants.ServiceStopTimeout); serviceCore.OnStop(); } class TcpPortSharingCore : SharingService { internal TcpPortSharingCore() : base(TransportType.Tcp, ListenerConstants.TcpPortSharingServiceName, ListenerConstants.TcpSharedMemoryName) { } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- HtmlTableCell.cs
- PriorityBinding.cs
- LinqDataSourceUpdateEventArgs.cs
- ChangeToolStripParentVerb.cs
- HierarchicalDataSourceDesigner.cs
- CFGGrammar.cs
- PageContent.cs
- NetMsmqBindingElement.cs
- ConstructorBuilder.cs
- WindowsListViewSubItem.cs
- BrowserDefinitionCollection.cs
- SerializationEventsCache.cs
- ToolBarOverflowPanel.cs
- IDataContractSurrogate.cs
- WindowsHyperlink.cs
- DataBindingList.cs
- RuntimeTransactionHandle.cs
- PowerStatus.cs
- PrivilegeNotHeldException.cs
- PropertyDescriptorCollection.cs
- CreateUserWizardDesigner.cs
- AcceptorSessionSymmetricTransportSecurityProtocol.cs
- ConfigXmlComment.cs
- XmlSiteMapProvider.cs
- HostedAspNetEnvironment.cs
- WebServiceBindingAttribute.cs
- StringHelper.cs
- SystemSounds.cs
- UserInitiatedNavigationPermission.cs
- SyntaxCheck.cs
- BaseParser.cs
- AdPostCacheSubstitution.cs
- TrackingCondition.cs
- SystemColorTracker.cs
- SchemaHelper.cs
- ItemsPanelTemplate.cs
- AttributeUsageAttribute.cs
- FocusTracker.cs
- EasingFunctionBase.cs
- BlockCollection.cs
- VectorAnimation.cs
- XmlHelper.cs
- PageBreakRecord.cs
- QueryReaderSettings.cs
- ProtectedConfigurationSection.cs
- SettingsBase.cs
- SqlProviderServices.cs
- EDesignUtil.cs
- NegotiationTokenAuthenticator.cs
- InstanceDataCollection.cs
- FontConverter.cs
- StrokeNodeOperations.cs
- LinkedResource.cs
- BufferAllocator.cs
- ColorDialog.cs
- KeyEvent.cs
- ListQueryResults.cs
- sqlnorm.cs
- Roles.cs
- _WinHttpWebProxyDataBuilder.cs
- SortedList.cs
- VectorAnimation.cs
- VisualBrush.cs
- SplineKeyFrames.cs
- DataRowComparer.cs
- StateItem.cs
- PageThemeCodeDomTreeGenerator.cs
- VolatileEnlistmentMultiplexing.cs
- WebCategoryAttribute.cs
- DetailsViewModeEventArgs.cs
- TableLayoutCellPaintEventArgs.cs
- PersonalizationProvider.cs
- ConstraintEnumerator.cs
- StateMachine.cs
- SqlConnectionFactory.cs
- Table.cs
- PathSegmentCollection.cs
- cache.cs
- CanExecuteRoutedEventArgs.cs
- AutoGeneratedField.cs
- DateTime.cs
- ResXResourceSet.cs
- MD5CryptoServiceProvider.cs
- TextWriter.cs
- ListControl.cs
- InputLangChangeRequestEvent.cs
- EncoderNLS.cs
- OdbcDataReader.cs
- TabRenderer.cs
- EntityClassGenerator.cs
- FontSource.cs
- SoapHeaderAttribute.cs
- smtppermission.cs
- QueryCacheEntry.cs
- ExpressionBuilder.cs
- CodeIterationStatement.cs
- CultureTableRecord.cs
- CreateSequence.cs
- ObjectQueryProvider.cs
- XmlDataSourceView.cs