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
- StorageEntityTypeMapping.cs
- XPathNodePointer.cs
- PathFigureCollection.cs
- Internal.cs
- ProcessHostFactoryHelper.cs
- SafeRightsManagementSessionHandle.cs
- DragCompletedEventArgs.cs
- UriExt.cs
- SocketException.cs
- BuildProvidersCompiler.cs
- ExceptionWrapper.cs
- List.cs
- MenuItemBinding.cs
- HttpCachePolicy.cs
- ComponentConverter.cs
- StringFreezingAttribute.cs
- _CookieModule.cs
- Animatable.cs
- PipelineModuleStepContainer.cs
- FamilyMap.cs
- TableDetailsRow.cs
- objectquery_tresulttype.cs
- ComponentResourceKey.cs
- FragmentNavigationEventArgs.cs
- PreProcessInputEventArgs.cs
- SingleConverter.cs
- ToolStripSystemRenderer.cs
- Invariant.cs
- ProfilePropertyNameValidator.cs
- HttpHeaderCollection.cs
- TypeElementCollection.cs
- SafeNativeMethods.cs
- GacUtil.cs
- OleDbDataReader.cs
- PropertyDescriptor.cs
- LocalizationParserHooks.cs
- ContextMenuService.cs
- CalculatedColumn.cs
- ParserStack.cs
- StringConverter.cs
- CodeParameterDeclarationExpressionCollection.cs
- DataSysAttribute.cs
- SoapCodeExporter.cs
- CannotUnloadAppDomainException.cs
- UriSection.cs
- HMACSHA384.cs
- DataControlField.cs
- BindableTemplateBuilder.cs
- StringKeyFrameCollection.cs
- ConnectionManagementElement.cs
- SecurityKeyUsage.cs
- RegionInfo.cs
- EventHandlerList.cs
- OracleParameterBinding.cs
- Triangle.cs
- DesignerHierarchicalDataSourceView.cs
- ShapeTypeface.cs
- HtmlTextBoxAdapter.cs
- DATA_BLOB.cs
- followingsibling.cs
- SendKeys.cs
- ObjectKeyFrameCollection.cs
- Win32Native.cs
- HtmlProps.cs
- UserPreferenceChangedEventArgs.cs
- SiteMapDataSource.cs
- CommandConverter.cs
- ImageButton.cs
- Internal.cs
- BitmapCodecInfoInternal.cs
- SynthesizerStateChangedEventArgs.cs
- XmlBoundElement.cs
- ToolStripSeparatorRenderEventArgs.cs
- CompositionAdorner.cs
- StorageRoot.cs
- NumericPagerField.cs
- SystemTcpConnection.cs
- RecommendedAsConfigurableAttribute.cs
- SHA512.cs
- SettingsSection.cs
- ToolStripLocationCancelEventArgs.cs
- EventDescriptor.cs
- _ConnectStream.cs
- EntitySqlException.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- StylusOverProperty.cs
- WebPartConnectionsCloseVerb.cs
- SimpleTextLine.cs
- UserMapPath.cs
- AsyncStreamReader.cs
- DirectionalLight.cs
- CancellationState.cs
- Quaternion.cs
- User.cs
- BinarySerializer.cs
- FullTextLine.cs
- MatchNoneMessageFilter.cs
- CompilerState.cs
- ReflectEventDescriptor.cs
- SafeMarshalContext.cs