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
- BindStream.cs
- WebPartZone.cs
- AnimationTimeline.cs
- RuntimeResourceSet.cs
- HitTestResult.cs
- TextPattern.cs
- InProcStateClientManager.cs
- MetadataItem.cs
- CellRelation.cs
- StructuredTypeInfo.cs
- odbcmetadatacolumnnames.cs
- XmlnsCompatibleWithAttribute.cs
- EdmProperty.cs
- Oid.cs
- ServiceContractListItem.cs
- ScriptControl.cs
- FileDataSourceCache.cs
- AdRotatorDesigner.cs
- AutoResizedEvent.cs
- RedBlackList.cs
- SharedRuntimeState.cs
- SchemaCreator.cs
- DataObjectSettingDataEventArgs.cs
- RsaKeyGen.cs
- SimplePropertyEntry.cs
- ContextConfiguration.cs
- CodeStatement.cs
- OpenFileDialog.cs
- SchemeSettingElementCollection.cs
- PreviewPrintController.cs
- TextEndOfParagraph.cs
- TextMetrics.cs
- ListViewCommandEventArgs.cs
- EndpointInstanceProvider.cs
- DateTimeFormat.cs
- SmiMetaDataProperty.cs
- DialogResultConverter.cs
- AutoGeneratedField.cs
- SeverityFilter.cs
- HttpConfigurationContext.cs
- SecurityTokenReferenceStyle.cs
- Stroke.cs
- BamlTreeMap.cs
- DetailsViewRow.cs
- ModelItemDictionary.cs
- NetCodeGroup.cs
- ToolStrip.cs
- HttpCookie.cs
- XmlQualifiedName.cs
- XXXOnTypeBuilderInstantiation.cs
- MdiWindowListItemConverter.cs
- ToolStripProgressBar.cs
- XsltContext.cs
- PasswordTextContainer.cs
- DeflateEmulationStream.cs
- HttpHostedTransportConfiguration.cs
- AdornerDecorator.cs
- DisableDpiAwarenessAttribute.cs
- GraphicsContainer.cs
- Exceptions.cs
- ProtocolsConfiguration.cs
- TreeWalker.cs
- BaseResourcesBuildProvider.cs
- DeviceSpecificDesigner.cs
- SchemaTypeEmitter.cs
- ComplexObject.cs
- ViewStateException.cs
- DateTimeStorage.cs
- RadioButtonList.cs
- BindingsCollection.cs
- CodeDomConfigurationHandler.cs
- ServiceModelConfigurationSectionGroup.cs
- SID.cs
- RightsManagementEncryptedStream.cs
- BooleanAnimationBase.cs
- EdgeModeValidation.cs
- XmlIlGenerator.cs
- Preprocessor.cs
- IriParsingElement.cs
- ListBoxChrome.cs
- HostedTransportConfigurationBase.cs
- StrictModeSecurityHeaderElementInferenceEngine.cs
- ClickablePoint.cs
- InteropExecutor.cs
- ReferentialConstraintRoleElement.cs
- DirectoryNotFoundException.cs
- ScrollViewerAutomationPeer.cs
- ListControlConvertEventArgs.cs
- FlowPosition.cs
- DataGridViewEditingControlShowingEventArgs.cs
- OleDbWrapper.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- FixedMaxHeap.cs
- XmlIlVisitor.cs
- HintTextMaxWidthConverter.cs
- MatrixValueSerializer.cs
- DtrList.cs
- ConfigXmlCDataSection.cs
- CompareInfo.cs
- DataGridCommandEventArgs.cs