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
- IChannel.cs
- ChangeProcessor.cs
- RepeaterItem.cs
- LocatorManager.cs
- PtsCache.cs
- Rijndael.cs
- PersonalizationState.cs
- NodeFunctions.cs
- HtmlElementErrorEventArgs.cs
- ReadOnlyHierarchicalDataSourceView.cs
- TimelineClockCollection.cs
- LogReserveAndAppendState.cs
- MachineKey.cs
- PersonalizationStateInfoCollection.cs
- NameValuePermission.cs
- WebPartVerbCollection.cs
- WCFServiceClientProxyGenerator.cs
- safemediahandle.cs
- SqlDataSourceFilteringEventArgs.cs
- PeerCollaborationPermission.cs
- ManifestSignedXml.cs
- templategroup.cs
- DataReceivedEventArgs.cs
- ObjectManager.cs
- TimelineGroup.cs
- CacheChildrenQuery.cs
- CompoundFileReference.cs
- PathTooLongException.cs
- TableCellCollection.cs
- CfgParser.cs
- ApplicationInfo.cs
- PeerToPeerException.cs
- ProfileProvider.cs
- GridViewUpdatedEventArgs.cs
- DataList.cs
- AllMembershipCondition.cs
- __Filters.cs
- SqlProcedureAttribute.cs
- PropertyInfoSet.cs
- DescriptionCreator.cs
- ScriptControlDescriptor.cs
- FlowDecision.cs
- MsmqIntegrationBindingElement.cs
- AssemblyAttributesGoHere.cs
- UrlPath.cs
- Grammar.cs
- SQLMembershipProvider.cs
- HasRunnableWorkflowEvent.cs
- ObfuscateAssemblyAttribute.cs
- StylusEventArgs.cs
- BamlRecordWriter.cs
- RequestCache.cs
- ParagraphResult.cs
- DataListItemEventArgs.cs
- metadatamappinghashervisitor.cs
- ImageUrlEditor.cs
- SaveFileDialog.cs
- Script.cs
- Rule.cs
- Selection.cs
- ManipulationVelocities.cs
- SettingsBindableAttribute.cs
- ListViewItemEventArgs.cs
- ComAdminWrapper.cs
- OrderPreservingSpoolingTask.cs
- TrackPointCollection.cs
- SerializationUtilities.cs
- Metadata.cs
- EntitySqlQueryCacheEntry.cs
- ListenerUnsafeNativeMethods.cs
- WsdlImporterElementCollection.cs
- IDictionary.cs
- TreeNodeStyleCollection.cs
- ProtectedConfigurationSection.cs
- VisualStyleRenderer.cs
- DaylightTime.cs
- PathTooLongException.cs
- WorkflowCommandExtensionItem.cs
- ToggleButtonAutomationPeer.cs
- WSHttpSecurity.cs
- CacheMemory.cs
- Hashtable.cs
- EncoderBestFitFallback.cs
- TypeForwardedToAttribute.cs
- WeakReferenceKey.cs
- XPathScanner.cs
- DataTableExtensions.cs
- InternalSendMessage.cs
- ToolStripPanel.cs
- StyleXamlTreeBuilder.cs
- DbConnectionPool.cs
- DBConnection.cs
- OperationParameterInfo.cs
- UIElementPropertyUndoUnit.cs
- TypeInitializationException.cs
- RegexRunner.cs
- SendMailErrorEventArgs.cs
- XmlCharType.cs
- KeyboardNavigation.cs
- AuthenticationService.cs