Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / SMSvcHost / System / ServiceModel / Activation / TcpWorkerProcess.cs / 1 / TcpWorkerProcess.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.Net.Sockets; 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 TcpWorkerProcess : WorkerProcess { protected override DuplicateContext DuplicateConnection(ListenerSessionConnection session) { bool success = false; SocketInformation dupedSocket = default(SocketInformation); try { dupedSocket = (SocketInformation)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 == 10022 // B) we fail to duplicate handle because the WorkerProcess is exiting/exited NativeErrorCode == 10024 // - 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 SocketException) { Debug.Print("TcpWorkerProcess.DuplicateConnection() failed duplicating socket for processId: " + this.ProcessId + " errorCode:" + ((SocketException)exception).NativeErrorCode + " exception:" + exception.Message); } #endif if (DiagnosticUtility.ShouldTraceError) { ListenerTraceUtility.TraceEvent(TraceEventType.Error, TraceCode.MessageQueueDuplicatedSocketError, this, exception); } } if (success) { if (DiagnosticUtility.ShouldTraceInformation) { ListenerTraceUtility.TraceEvent(TraceEventType.Information, TraceCode.MessageQueueDuplicatedSocket, this); } return new TcpDuplicateContext(dupedSocket, session.Via, session.Data); } return null; } protected override void OnDispatchSuccess() { ListenerPerfCounters.IncrementConnectionsDispatchedTcp(); } protected override TransportType TransportType { get { return TransportType.Tcp; } } } } // 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
- AutomationElementCollection.cs
- SurrogateSelector.cs
- Enlistment.cs
- DataGridViewComboBoxEditingControl.cs
- FieldDescriptor.cs
- UnicastIPAddressInformationCollection.cs
- ComboBoxItem.cs
- TimeSpanMinutesConverter.cs
- VolatileEnlistmentState.cs
- DynamicRenderer.cs
- SchemaObjectWriter.cs
- RenderData.cs
- LineSegment.cs
- SafeUserTokenHandle.cs
- RadioButton.cs
- XamlSerializerUtil.cs
- Bits.cs
- InputReportEventArgs.cs
- PolicyException.cs
- SelectQueryOperator.cs
- RuntimeHelpers.cs
- SpecularMaterial.cs
- ActivationArguments.cs
- GroupItemAutomationPeer.cs
- InvalidProgramException.cs
- ISFClipboardData.cs
- RenderContext.cs
- NamedObject.cs
- DragDrop.cs
- DataControlButton.cs
- PropertyInformation.cs
- MetadataCache.cs
- SetStateEventArgs.cs
- WindowsListBox.cs
- StateMachineHelpers.cs
- ManipulationInertiaStartingEventArgs.cs
- sqlcontext.cs
- EntityContainer.cs
- ColumnMapProcessor.cs
- ApplicationException.cs
- HTMLTextWriter.cs
- DbConnectionPoolGroup.cs
- BookmarkScopeHandle.cs
- PersistenceProviderBehavior.cs
- Int64.cs
- Currency.cs
- DependencyObjectPropertyDescriptor.cs
- TypeBrowser.xaml.cs
- Point3DCollection.cs
- HandledMouseEvent.cs
- StyleSelector.cs
- NumberFunctions.cs
- CommandBindingCollection.cs
- DataGridAddNewRow.cs
- XmlBinaryReader.cs
- ConnectionOrientedTransportElement.cs
- Accessible.cs
- Stack.cs
- odbcmetadatacollectionnames.cs
- SettingsPropertyIsReadOnlyException.cs
- TreeViewDesigner.cs
- PackWebResponse.cs
- MissingMemberException.cs
- Evidence.cs
- WebPartManager.cs
- SizeValueSerializer.cs
- CodeDOMUtility.cs
- FtpCachePolicyElement.cs
- TextServicesCompartmentContext.cs
- ConfigurationValidatorAttribute.cs
- PublisherMembershipCondition.cs
- ObjectStateEntryDbUpdatableDataRecord.cs
- MessageSecurityVersionConverter.cs
- HyperlinkAutomationPeer.cs
- HintTextConverter.cs
- TextRangeEditLists.cs
- CommonRemoteMemoryBlock.cs
- InkCanvasFeedbackAdorner.cs
- XmlSchemas.cs
- StoragePropertyMapping.cs
- HtmlString.cs
- PageClientProxyGenerator.cs
- ContentElement.cs
- SessionParameter.cs
- RectKeyFrameCollection.cs
- OdbcError.cs
- HwndHost.cs
- TypeExtensions.cs
- DataRelationPropertyDescriptor.cs
- ToReply.cs
- NamespaceInfo.cs
- TypeToStringValueConverter.cs
- ObjectViewFactory.cs
- FloaterParagraph.cs
- DataGridViewCellLinkedList.cs
- SettingsBase.cs
- ServiceSecurityContext.cs
- BrushValueSerializer.cs
- TaskbarItemInfo.cs
- ExceptionWrapper.cs