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
- DataViewListener.cs
- JavaScriptObjectDeserializer.cs
- Mappings.cs
- MessageQueueInstaller.cs
- GenericUriParser.cs
- FixedLineResult.cs
- Pair.cs
- SiblingIterators.cs
- Validator.cs
- RootAction.cs
- Freezable.cs
- StyleCollectionEditor.cs
- XmlSigningNodeWriter.cs
- HttpClientCertificate.cs
- HtmlInputText.cs
- HtmlInputHidden.cs
- storepermission.cs
- FixedDocumentPaginator.cs
- UpdatableGenericsFeature.cs
- StyleTypedPropertyAttribute.cs
- UserControlParser.cs
- XmlCustomFormatter.cs
- VerticalAlignConverter.cs
- VisualBasicExpressionConverter.cs
- VirtualPath.cs
- DecoderNLS.cs
- WebPartEditorOkVerb.cs
- SimpleTypeResolver.cs
- HostProtectionException.cs
- UnsafeNativeMethodsCLR.cs
- _SafeNetHandles.cs
- TreeNodeClickEventArgs.cs
- XmlAttributes.cs
- Trace.cs
- ControlDesignerState.cs
- BezierSegment.cs
- PointKeyFrameCollection.cs
- MetafileHeaderWmf.cs
- KeyEvent.cs
- AuthenticateEventArgs.cs
- EmptyEnumerable.cs
- ToolStripItemImageRenderEventArgs.cs
- XmlValidatingReader.cs
- UnsafeNativeMethods.cs
- XmlWrappingReader.cs
- BoolExpression.cs
- PriorityRange.cs
- HTMLTextWriter.cs
- FixedSOMTableRow.cs
- PropertySourceInfo.cs
- TypeProvider.cs
- HttpProcessUtility.cs
- MarkupProperty.cs
- Command.cs
- ParamArrayAttribute.cs
- MeasureItemEvent.cs
- DataGridLinkButton.cs
- ObjectListSelectEventArgs.cs
- DesignerUtility.cs
- TextPenaltyModule.cs
- CustomAttributeBuilder.cs
- InstancePersistenceEvent.cs
- TracedNativeMethods.cs
- CodeDirectionExpression.cs
- OracleConnection.cs
- SerializationInfoEnumerator.cs
- DebugView.cs
- UserControl.cs
- TransactionsSectionGroup.cs
- DecoderFallback.cs
- PkcsUtils.cs
- GroupDescription.cs
- Transform.cs
- PhoneCall.cs
- SqlXml.cs
- WinEventWrap.cs
- EntityRecordInfo.cs
- HostingEnvironment.cs
- HttpRuntime.cs
- NumberAction.cs
- ContextMenuStripGroupCollection.cs
- UserControlFileEditor.cs
- SizeConverter.cs
- XPathChildIterator.cs
- SessionStateItemCollection.cs
- DataSourceHelper.cs
- DataListDesigner.cs
- AssociativeAggregationOperator.cs
- FileDialog.cs
- FormsAuthenticationCredentials.cs
- OleDbParameterCollection.cs
- RegexCaptureCollection.cs
- StylusSystemGestureEventArgs.cs
- SqlDependency.cs
- Drawing.cs
- DbParameterCollectionHelper.cs
- DataGridViewHitTestInfo.cs
- ListViewGroupConverter.cs
- PipeStream.cs
- CodeExpressionStatement.cs