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
- Schema.cs
- listviewsubitemcollectioneditor.cs
- StylusLogic.cs
- AssemblyBuilder.cs
- InvariantComparer.cs
- WCFBuildProvider.cs
- COM2IVsPerPropertyBrowsingHandler.cs
- TraceHandler.cs
- PagesChangedEventArgs.cs
- DownloadProgressEventArgs.cs
- AssemblyName.cs
- ImageClickEventArgs.cs
- ProfileService.cs
- Fonts.cs
- MimeTypeMapper.cs
- XmlUtil.cs
- UTF7Encoding.cs
- HitTestWithPointDrawingContextWalker.cs
- TdsParser.cs
- SrgsGrammarCompiler.cs
- FontDialog.cs
- FigureParaClient.cs
- ZipPackage.cs
- ReceiveMessageAndVerifySecurityAsyncResultBase.cs
- WmfPlaceableFileHeader.cs
- NavigationWindowAutomationPeer.cs
- DelegatingConfigHost.cs
- Attributes.cs
- ScriptManagerProxy.cs
- SeekStoryboard.cs
- StickyNoteHelper.cs
- ThumbAutomationPeer.cs
- DataGridPageChangedEventArgs.cs
- FilteredXmlReader.cs
- ToolStripItemGlyph.cs
- TransformCollection.cs
- ProfilePropertySettings.cs
- MergeFilterQuery.cs
- CalendarKeyboardHelper.cs
- CallTemplateAction.cs
- SHA384.cs
- StringInfo.cs
- VersionedStream.cs
- CfgParser.cs
- StackOverflowException.cs
- _RequestLifetimeSetter.cs
- ScopedMessagePartSpecification.cs
- DataGridViewBand.cs
- InternalControlCollection.cs
- TTSEngineTypes.cs
- EventArgs.cs
- ItemList.cs
- SqlMethodCallConverter.cs
- SynchronizationLockException.cs
- IteratorFilter.cs
- ISAPIRuntime.cs
- CodeDOMUtility.cs
- ListViewItem.cs
- AdPostCacheSubstitution.cs
- RequestCacheManager.cs
- TokenBasedSetEnumerator.cs
- PictureBox.cs
- DateTimePicker.cs
- recordstate.cs
- __ConsoleStream.cs
- EntityTypeEmitter.cs
- WebContext.cs
- Publisher.cs
- activationcontext.cs
- InstanceBehavior.cs
- LineServicesRun.cs
- DropDownList.cs
- Color.cs
- SqlExpressionNullability.cs
- FlowDocumentScrollViewerAutomationPeer.cs
- InputScope.cs
- CredentialCache.cs
- StateDesigner.Helpers.cs
- PrimitiveSchema.cs
- EntityDataSourceConfigureObjectContext.cs
- UrlMappingsModule.cs
- QuaternionAnimation.cs
- CodeAttributeDeclaration.cs
- IndexedWhereQueryOperator.cs
- ControlUtil.cs
- HttpModuleCollection.cs
- Vector3DAnimationBase.cs
- SmtpCommands.cs
- HMACSHA512.cs
- ToolStripPanelRenderEventArgs.cs
- ADMembershipProvider.cs
- DataGridViewRowConverter.cs
- SystemUnicastIPAddressInformation.cs
- ThreadStaticAttribute.cs
- ClientTargetCollection.cs
- ColumnHeader.cs
- FileDialog.cs
- QueryAccessibilityHelpEvent.cs
- GridViewColumnCollectionChangedEventArgs.cs
- Util.cs