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
- ConnectionStringSettingsCollection.cs
- DurableTimerExtension.cs
- TypeUnloadedException.cs
- ObfuscateAssemblyAttribute.cs
- RegexMatch.cs
- DefaultValueAttribute.cs
- ListViewUpdateEventArgs.cs
- RequestDescription.cs
- DoubleCollection.cs
- safemediahandle.cs
- ThreadSafeList.cs
- TraceData.cs
- KeyEvent.cs
- ValueQuery.cs
- NullableConverter.cs
- SafeHandles.cs
- BindingListCollectionView.cs
- KeyGestureConverter.cs
- EncryptedType.cs
- ImageMapEventArgs.cs
- TcpTransportBindingElement.cs
- FixedDocumentPaginator.cs
- WindowsSecurityTokenAuthenticator.cs
- TableLayout.cs
- SegmentInfo.cs
- LocalBuilder.cs
- TreeNodeClickEventArgs.cs
- ColorContext.cs
- OrderedDictionary.cs
- Hex.cs
- SettingsPropertyWrongTypeException.cs
- CheckBoxPopupAdapter.cs
- HwndKeyboardInputProvider.cs
- CollectionViewGroupRoot.cs
- HtmlTableRow.cs
- DescendantQuery.cs
- CustomPeerResolverService.cs
- PropertyChangedEventArgs.cs
- Number.cs
- RolePrincipal.cs
- LoginCancelEventArgs.cs
- Tracking.cs
- ObservableCollectionDefaultValueFactory.cs
- HttpWebResponse.cs
- ExpressionBindingsDialog.cs
- IdleTimeoutMonitor.cs
- PerformanceCounterManager.cs
- DataControlFieldHeaderCell.cs
- CodeBlockBuilder.cs
- QuaternionRotation3D.cs
- PrintPageEvent.cs
- PageCanvasSize.cs
- DynamicPropertyHolder.cs
- ButtonColumn.cs
- PtsPage.cs
- Transform3D.cs
- RuntimeConfig.cs
- CodeAccessSecurityEngine.cs
- HtmlEmptyTagControlBuilder.cs
- CodeTypeDelegate.cs
- PropertyNames.cs
- LinkedDataMemberFieldEditor.cs
- CodeDOMProvider.cs
- SchemaImporterExtensionElementCollection.cs
- EncoderFallback.cs
- AttachedPropertyDescriptor.cs
- ItemMap.cs
- JsonWriter.cs
- CommandHelpers.cs
- DataGridViewImageColumn.cs
- WindowsIPAddress.cs
- DispatchWrapper.cs
- TrueReadOnlyCollection.cs
- GridItemCollection.cs
- XmlQueryContext.cs
- Source.cs
- UpdateCommand.cs
- DataGridCaption.cs
- TransformProviderWrapper.cs
- Label.cs
- TableStyle.cs
- XmlILTrace.cs
- ConcurrencyBehavior.cs
- SspiHelper.cs
- ObjectViewQueryResultData.cs
- StylusDownEventArgs.cs
- DetailsViewRowCollection.cs
- XmlEntity.cs
- DataGridViewCellFormattingEventArgs.cs
- SafeBitVector32.cs
- MenuAdapter.cs
- OleDbConnection.cs
- InvokeMethod.cs
- ImpersonationContext.cs
- AttachmentService.cs
- PropertyInfo.cs
- BitmapEffectGeneralTransform.cs
- SplineKeyFrames.cs
- MetadataAssemblyHelper.cs
- FormViewInsertEventArgs.cs