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
- columnmapkeybuilder.cs
- VectorConverter.cs
- BuildManager.cs
- HintTextConverter.cs
- SapiRecoContext.cs
- OLEDB_Util.cs
- Propagator.JoinPropagator.cs
- CodeVariableReferenceExpression.cs
- XPathDescendantIterator.cs
- recordstate.cs
- SnapLine.cs
- ContextBase.cs
- DBPropSet.cs
- DataServiceProcessingPipelineEventArgs.cs
- Classification.cs
- DataGridViewColumn.cs
- TypefaceMetricsCache.cs
- CompModSwitches.cs
- BitStream.cs
- DocumentEventArgs.cs
- XmlCodeExporter.cs
- BasicKeyConstraint.cs
- StrongName.cs
- Tracking.cs
- CardSpaceShim.cs
- XamlToRtfWriter.cs
- DataPointer.cs
- WebPartMovingEventArgs.cs
- dtdvalidator.cs
- EntityDataReader.cs
- ExpressionLexer.cs
- BitmapCache.cs
- DataGridViewCellValidatingEventArgs.cs
- OdbcPermission.cs
- COM2Enum.cs
- ImportDesigner.xaml.cs
- MetafileEditor.cs
- ThreadPool.cs
- TextServicesPropertyRanges.cs
- DataGridColumnHeaderCollection.cs
- DictionaryBase.cs
- KeyProperty.cs
- AccessViolationException.cs
- NetworkInterface.cs
- SchemaContext.cs
- BindUriHelper.cs
- PixelShader.cs
- ActionMessageFilterTable.cs
- SmtpFailedRecipientsException.cs
- MediaPlayer.cs
- DictionaryCustomTypeDescriptor.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- DbExpressionVisitor.cs
- PropertyDescriptorComparer.cs
- Authorization.cs
- SQLMoney.cs
- ExpressionBuilder.cs
- CreateBookmarkScope.cs
- BlurBitmapEffect.cs
- ParserStack.cs
- XmlSchemaSet.cs
- oledbconnectionstring.cs
- _LocalDataStoreMgr.cs
- AssemblyCollection.cs
- SR.cs
- PermissionListSet.cs
- SymDocumentType.cs
- JsonCollectionDataContract.cs
- XPathNodeHelper.cs
- TreeBuilderXamlTranslator.cs
- TreeViewHitTestInfo.cs
- RoleManagerEventArgs.cs
- CommentAction.cs
- TreeNode.cs
- ScriptHandlerFactory.cs
- GifBitmapEncoder.cs
- BaseTemplateBuildProvider.cs
- DataKey.cs
- XPathNodeInfoAtom.cs
- DocumentViewerBase.cs
- ArrayTypeMismatchException.cs
- HttpServerChannel.cs
- EqualityComparer.cs
- ControllableStoryboardAction.cs
- FixedSOMTableRow.cs
- ResumeStoryboard.cs
- OleDbCommand.cs
- GlobalizationAssembly.cs
- KeySplineConverter.cs
- PeerTransportListenAddressValidator.cs
- Object.cs
- WebOperationContext.cs
- ScriptReferenceBase.cs
- TextReturnReader.cs
- ProviderUtil.cs
- CompositionDesigner.cs
- BuiltInExpr.cs
- HttpListener.cs
- Literal.cs
- StringFreezingAttribute.cs