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
- WebPartExportVerb.cs
- UserNamePasswordValidationMode.cs
- SettingsBindableAttribute.cs
- TextModifier.cs
- QueryInterceptorAttribute.cs
- RequestChannel.cs
- RuleCache.cs
- GeometryDrawing.cs
- HMACSHA384.cs
- HttpListener.cs
- XmlKeywords.cs
- DataControlButton.cs
- HtmlControlDesigner.cs
- GridViewItemAutomationPeer.cs
- XslAstAnalyzer.cs
- WindowsPrincipal.cs
- EventLogger.cs
- Transform3D.cs
- WsdlParser.cs
- QuaternionValueSerializer.cs
- WindowsListViewScroll.cs
- CatalogPart.cs
- WebProxyScriptElement.cs
- WebResponse.cs
- CompensatableSequenceActivity.cs
- CompilerParameters.cs
- xamlnodes.cs
- ArrayElementGridEntry.cs
- HttpListenerContext.cs
- COM2FontConverter.cs
- AsyncStreamReader.cs
- DBAsyncResult.cs
- ContentPlaceHolder.cs
- StringDictionary.cs
- BitSet.cs
- ProfileBuildProvider.cs
- TemplateBindingExtensionConverter.cs
- CodeIndexerExpression.cs
- MemberPath.cs
- Crc32Helper.cs
- MarginCollapsingState.cs
- MimeFormImporter.cs
- HtmlLabelAdapter.cs
- SoapTypeAttribute.cs
- XamlPoint3DCollectionSerializer.cs
- DrawingGroup.cs
- DesignBindingValueUIHandler.cs
- TextBoxRenderer.cs
- UInt64Converter.cs
- SequentialUshortCollection.cs
- CodeArrayCreateExpression.cs
- ClientRuntimeConfig.cs
- FixedSchema.cs
- ResourceKey.cs
- ProgressPage.cs
- TablePatternIdentifiers.cs
- TreeViewAutomationPeer.cs
- _SslStream.cs
- DataSourceSelectArguments.cs
- ActivationArguments.cs
- BidOverLoads.cs
- SqlDuplicator.cs
- BaseParser.cs
- _Win32.cs
- Matrix3DStack.cs
- CorruptStoreException.cs
- CryptoApi.cs
- OracleNumber.cs
- WorkflowMarkupElementEventArgs.cs
- DBDataPermission.cs
- TearOffProxy.cs
- ScrollBarRenderer.cs
- Page.cs
- GeometryConverter.cs
- UxThemeWrapper.cs
- CapiSafeHandles.cs
- UpdateProgress.cs
- DecimalConverter.cs
- DynamicEndpoint.cs
- ColorConverter.cs
- HtmlInputReset.cs
- XamlFrame.cs
- CacheRequest.cs
- XhtmlConformanceSection.cs
- ClickablePoint.cs
- TraceData.cs
- Helper.cs
- Screen.cs
- ListViewInsertEventArgs.cs
- Models.cs
- UserControl.cs
- DefaultValueTypeConverter.cs
- ClosureBinding.cs
- WhiteSpaceTrimStringConverter.cs
- CodeSubDirectoriesCollection.cs
- InternalConfigHost.cs
- PenLineJoinValidation.cs
- Rectangle.cs
- documentsequencetextcontainer.cs
- PriorityBinding.cs