Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / SMSvcHost / System / ServiceModel / Activation / NamedPipeWorkerProcess.cs / 1 / NamedPipeWorkerProcess.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.ServiceModel.Activation { using System; using System.Diagnostics; using System.Globalization; using System.ServiceModel; using System.ServiceModel.Channels; using System.ServiceModel.Diagnostics; using System.ServiceModel.Activation.Diagnostics; using EventLogCategory = System.ServiceModel.Diagnostics.EventLogCategory; using EventLogEventId = System.ServiceModel.Diagnostics.EventLogEventId; class NamedPipeWorkerProcess : WorkerProcess { protected override DuplicateContext DuplicateConnection(ListenerSessionConnection session) { bool success = false; IntPtr dupedPipe = IntPtr.Zero; try { dupedPipe = (IntPtr)session.Connection.DuplicateAndClose(this.ProcessId); success = true; } #pragma warning suppress 56500 // covered by FxCOP catch (Exception exception) { if (DiagnosticUtility.IsFatal(exception)) { throw; } // this normally happens if: // A) we don't have rights to duplicate handles to the WorkerProcess NativeErrorCode == 87 // B) we fail to duplicate handle because the WorkerProcess is exiting/exited NativeErrorCode == ??? // - in the self hosted case: report error to the client // - in the web hosted case: roundrobin to the next available WorkerProcess (if this WorkerProcess is down?) #if DEBUG if (exception is CommunicationException) { int errorCode = ((System.IO.PipeException)exception.InnerException).ErrorCode; Debug.Print("NamedPipeWorkerProcess.DuplicateConnection() failed duplicating pipe for processId: " + this.ProcessId + " errorCode:" + errorCode + " exception:" + exception.Message); } #endif if (DiagnosticUtility.ShouldTraceError) { ListenerTraceUtility.TraceEvent(TraceEventType.Error, TraceCode.MessageQueueDuplicatedPipe, this, exception); } } if (success) { if (DiagnosticUtility.ShouldTraceInformation) { ListenerTraceUtility.TraceEvent(TraceEventType.Information, TraceCode.MessageQueueDuplicatedPipe, this); } return new NamedPipeDuplicateContext(dupedPipe, session.Via, session.Data); } return null; } protected override void OnDispatchSuccess() { ListenerPerfCounters.IncrementConnectionsDispatchedNamedPipe(); } protected override TransportType TransportType { get { return TransportType.NamedPipe; } } } } // 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
- XmlNode.cs
- KnownTypeDataContractResolver.cs
- FrameworkTemplate.cs
- ProfilePropertySettings.cs
- JsonWriter.cs
- ImportContext.cs
- ArrayConverter.cs
- XPathExpr.cs
- CurrencyWrapper.cs
- SqlClientFactory.cs
- SoapSchemaImporter.cs
- MSG.cs
- State.cs
- LiteralDesigner.cs
- NamespaceDecl.cs
- ButtonBaseAutomationPeer.cs
- StateWorkerRequest.cs
- BrowserDefinition.cs
- MsmqMessageSerializationFormat.cs
- RoutedEventValueSerializer.cs
- Panel.cs
- XmlNodeWriter.cs
- RSAPKCS1SignatureDeformatter.cs
- ImportOptions.cs
- PolicyChain.cs
- ObjectSpanRewriter.cs
- DataGridViewColumnDesignTimeVisibleAttribute.cs
- ButtonField.cs
- BitmapFrame.cs
- SettingsAttributes.cs
- FindCriteria11.cs
- _IPv6Address.cs
- VisualProxy.cs
- JsonEncodingStreamWrapper.cs
- QueryOptionExpression.cs
- AnnotationObservableCollection.cs
- Int32CollectionConverter.cs
- PropertyMappingExceptionEventArgs.cs
- CallbackWrapper.cs
- Compensate.cs
- CompositeTypefaceMetrics.cs
- Graph.cs
- Operator.cs
- COM2ExtendedTypeConverter.cs
- Transform3DGroup.cs
- ExtendedPropertyInfo.cs
- CodeCompileUnit.cs
- StylusShape.cs
- HttpListenerTimeoutManager.cs
- FormatVersion.cs
- StringAttributeCollection.cs
- NavigatingCancelEventArgs.cs
- SynchronousSendBindingElement.cs
- AllMembershipCondition.cs
- OdbcConnectionString.cs
- XPathSelfQuery.cs
- AppDomainFactory.cs
- CorePropertiesFilter.cs
- CompiledXpathExpr.cs
- QilXmlWriter.cs
- HybridObjectCache.cs
- HtmlForm.cs
- WinEventWrap.cs
- FontDifferentiator.cs
- TabPanel.cs
- ObjectStorage.cs
- EntityDataSourceEntityTypeFilterConverter.cs
- RuleSetReference.cs
- WindowsScroll.cs
- PaperSource.cs
- ToolStripSplitStackLayout.cs
- WindowClosedEventArgs.cs
- CookieParameter.cs
- PerformanceCounterManager.cs
- ExpressionNormalizer.cs
- LineServicesCallbacks.cs
- DocumentSchemaValidator.cs
- RegexInterpreter.cs
- ColumnMapTranslator.cs
- SessionStateUtil.cs
- RouteTable.cs
- FormsAuthenticationConfiguration.cs
- XpsFilter.cs
- NamedPipeConnectionPoolSettings.cs
- PeerName.cs
- GradientBrush.cs
- ReceiveParametersContent.cs
- FileDialog.cs
- JsonCollectionDataContract.cs
- PropertyOverridesTypeEditor.cs
- PropertyInfoSet.cs
- NegatedCellConstant.cs
- ReferenceEqualityComparer.cs
- SelectionRangeConverter.cs
- EnvelopedSignatureTransform.cs
- ConfigXmlCDataSection.cs
- ServicePointManager.cs
- ScriptIgnoreAttribute.cs
- FolderBrowserDialog.cs
- DurableOperationAttribute.cs