Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Net / System / Net / Sockets / _DisconnectOverlappedAsyncResult.cs / 1305376 / _DisconnectOverlappedAsyncResult.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Net.Sockets { using System; using System.Net; using System.Runtime.InteropServices; using System.Threading; using Microsoft.Win32; // // DisconnectOverlappedAsyncResult - used to take care of storage for async Socket BeginAccept call. // internal class DisconnectOverlappedAsyncResult : BaseOverlappedAsyncResult { internal DisconnectOverlappedAsyncResult(Socket socket, Object asyncState, AsyncCallback asyncCallback): base(socket,asyncState,asyncCallback) { } // // This method will be called by us when the IO completes synchronously and // by the ThreadPool when the IO completes asynchronously. (only called on WinNT) // internal override object PostCompletion(int numBytes) { if (ErrorCode == (int)SocketError.Success) { Socket socket = (Socket)AsyncObject; socket.SetToDisconnected(); socket.m_RemoteEndPoint = null; } return base.PostCompletion(numBytes); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Net.Sockets { using System; using System.Net; using System.Runtime.InteropServices; using System.Threading; using Microsoft.Win32; // // DisconnectOverlappedAsyncResult - used to take care of storage for async Socket BeginAccept call. // internal class DisconnectOverlappedAsyncResult : BaseOverlappedAsyncResult { internal DisconnectOverlappedAsyncResult(Socket socket, Object asyncState, AsyncCallback asyncCallback): base(socket,asyncState,asyncCallback) { } // // This method will be called by us when the IO completes synchronously and // by the ThreadPool when the IO completes asynchronously. (only called on WinNT) // internal override object PostCompletion(int numBytes) { if (ErrorCode == (int)SocketError.Success) { Socket socket = (Socket)AsyncObject; socket.SetToDisconnected(); socket.m_RemoteEndPoint = null; } return base.PostCompletion(numBytes); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- WeakReference.cs
- Point3DAnimation.cs
- ScriptReference.cs
- metadatamappinghashervisitor.hashsourcebuilder.cs
- Deflater.cs
- WinFormsSecurity.cs
- PartitionResolver.cs
- XmlEventCache.cs
- RTLAwareMessageBox.cs
- ComNativeDescriptor.cs
- SimpleType.cs
- EventLogPermissionEntry.cs
- ping.cs
- PersonalizationProvider.cs
- MouseEvent.cs
- WebPartVerbCollection.cs
- TextBoxBase.cs
- SslStream.cs
- CodeStatement.cs
- StrongNameMembershipCondition.cs
- EventListener.cs
- Unit.cs
- ThemeDirectoryCompiler.cs
- RecognitionEventArgs.cs
- WorkflowEnvironment.cs
- CryptoHelper.cs
- HtmlTableRowCollection.cs
- InboundActivityHelper.cs
- InfoCardCryptoHelper.cs
- RelativeSource.cs
- TraceListeners.cs
- ContextDataSource.cs
- recordstate.cs
- SpellerHighlightLayer.cs
- HtmlFormWrapper.cs
- CalendarDataBindingHandler.cs
- RoleBoolean.cs
- MetadataHelper.cs
- SoapAttributeAttribute.cs
- DependencyObjectPropertyDescriptor.cs
- MsmqIntegrationAppDomainProtocolHandler.cs
- CodeMemberEvent.cs
- SmiContext.cs
- NullRuntimeConfig.cs
- MatrixKeyFrameCollection.cs
- XsltException.cs
- ParagraphVisual.cs
- NegatedCellConstant.cs
- DataColumnCollection.cs
- XmlSchemaElement.cs
- DbProviderFactories.cs
- EUCJPEncoding.cs
- TableRow.cs
- BuildManager.cs
- NonPrimarySelectionGlyph.cs
- processwaithandle.cs
- ThumbAutomationPeer.cs
- AssociationSetMetadata.cs
- IdentityValidationException.cs
- ComponentCollection.cs
- DataServiceExpressionVisitor.cs
- GAC.cs
- EventWaitHandleSecurity.cs
- HttpWebRequestElement.cs
- HTMLTextWriter.cs
- ClientTargetSection.cs
- BaseCAMarshaler.cs
- CompositeDesignerAccessibleObject.cs
- XmlSchemaComplexContentRestriction.cs
- TableItemPatternIdentifiers.cs
- SoapFaultCodes.cs
- HTTPNotFoundHandler.cs
- Style.cs
- OletxEnlistment.cs
- ChannelPoolSettingsElement.cs
- ConfigsHelper.cs
- Currency.cs
- WebPartConnectionsDisconnectVerb.cs
- LogManagementAsyncResult.cs
- State.cs
- DataGridDefaultColumnWidthTypeConverter.cs
- SimpleHandlerBuildProvider.cs
- NegationPusher.cs
- EditorZoneBase.cs
- TransformGroup.cs
- HostingEnvironmentWrapper.cs
- COM2PictureConverter.cs
- ProtectedUri.cs
- HexParser.cs
- DbConnectionFactory.cs
- HtmlButton.cs
- MethodExpr.cs
- IPHostEntry.cs
- IISMapPath.cs
- ImportContext.cs
- Pen.cs
- SamlAuthorizationDecisionStatement.cs
- _ConnectionGroup.cs
- DistributedTransactionPermission.cs
- SocketPermission.cs