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
- SQLDecimal.cs
- TransformPattern.cs
- NamedObject.cs
- ScriptingProfileServiceSection.cs
- DataGridViewToolTip.cs
- XmlWrappingWriter.cs
- DeflateStreamAsyncResult.cs
- IncrementalCompileAnalyzer.cs
- XPathEmptyIterator.cs
- ResXBuildProvider.cs
- InstancePersistenceEvent.cs
- AlignmentXValidation.cs
- ElementFactory.cs
- StorageEndPropertyMapping.cs
- FixedSOMTableCell.cs
- BuildProvider.cs
- ElementHostPropertyMap.cs
- Tablet.cs
- SmiRecordBuffer.cs
- DictationGrammar.cs
- TextTreeInsertElementUndoUnit.cs
- WindowsToolbar.cs
- Menu.cs
- InstanceNotReadyException.cs
- CacheOutputQuery.cs
- PageRequestManager.cs
- XmlUrlResolver.cs
- LineMetrics.cs
- IQueryable.cs
- ParallelTimeline.cs
- ValidationEventArgs.cs
- BStrWrapper.cs
- ApplicationFileParser.cs
- FunctionDetailsReader.cs
- Operand.cs
- ExpressionConverter.cs
- ObjectNotFoundException.cs
- GiveFeedbackEvent.cs
- PackageRelationshipSelector.cs
- HTMLTextWriter.cs
- TextBounds.cs
- RuntimeArgumentHandle.cs
- Attribute.cs
- __ConsoleStream.cs
- XmlUtf8RawTextWriter.cs
- MultiSelector.cs
- WindowsToolbarAsMenu.cs
- WebPart.cs
- PathGeometry.cs
- OleCmdHelper.cs
- GPRECTF.cs
- HashStream.cs
- RowBinding.cs
- CroppedBitmap.cs
- FtpWebResponse.cs
- InstanceHandleReference.cs
- BinaryFormatter.cs
- Hex.cs
- Font.cs
- CodeArrayIndexerExpression.cs
- _ConnectionGroup.cs
- ExecutionEngineException.cs
- WebMessageFormatHelper.cs
- SkewTransform.cs
- DocumentOrderComparer.cs
- LineUtil.cs
- Terminate.cs
- CalculatedColumn.cs
- SqlStatistics.cs
- ProfileInfo.cs
- XmlSchemaFacet.cs
- BitSet.cs
- DesignerSerializerAttribute.cs
- Documentation.cs
- _FtpControlStream.cs
- ToolStripTemplateNode.cs
- ToolStripItemClickedEventArgs.cs
- NetWebProxyFinder.cs
- ContainerParagraph.cs
- WindowsImpersonationContext.cs
- ACL.cs
- LinearKeyFrames.cs
- GorillaCodec.cs
- UshortList2.cs
- LogLogRecord.cs
- WebPartCloseVerb.cs
- BindingWorker.cs
- UIElement.cs
- PageContent.cs
- ObjectResult.cs
- SyndicationSerializer.cs
- ObjectHandle.cs
- XmlSerializer.cs
- IpcManager.cs
- DoubleUtil.cs
- UpDownBase.cs
- SafeProcessHandle.cs
- BasicViewGenerator.cs
- RouteData.cs
- GeneratedView.cs