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
- NetDataContractSerializer.cs
- CodePrimitiveExpression.cs
- CalendarDateRangeChangingEventArgs.cs
- BindingExpressionUncommonField.cs
- WindowsListViewItem.cs
- MimePart.cs
- OdbcDataAdapter.cs
- Evidence.cs
- AddressUtility.cs
- CallSiteOps.cs
- UnknownWrapper.cs
- VisualProxy.cs
- StrokeNodeData.cs
- CompoundFileStorageReference.cs
- EventLogger.cs
- InfoCardClaimCollection.cs
- UniqueEventHelper.cs
- RequestValidator.cs
- OleDbPermission.cs
- WebSysDefaultValueAttribute.cs
- QilFactory.cs
- MembershipValidatePasswordEventArgs.cs
- DataGridViewCellStyleChangedEventArgs.cs
- UnorderedHashRepartitionStream.cs
- CollaborationHelperFunctions.cs
- CharEntityEncoderFallback.cs
- FormatterConverter.cs
- CompilerResults.cs
- CodeConstructor.cs
- SettingsProviderCollection.cs
- NativeMethods.cs
- ListViewUpdatedEventArgs.cs
- TerminatorSinks.cs
- WebPartDisplayMode.cs
- PerformanceCounterCategory.cs
- BrowserTree.cs
- BaseResourcesBuildProvider.cs
- SHA256.cs
- EntryIndex.cs
- CompositeDuplexBindingElementImporter.cs
- XPathAncestorQuery.cs
- WebPartRestoreVerb.cs
- DataObjectAttribute.cs
- AccessibleObject.cs
- AuthenticationService.cs
- WorkItem.cs
- ResolveResponseInfo.cs
- FormatterConverter.cs
- ModifierKeysConverter.cs
- LightweightCodeGenerator.cs
- _NestedSingleAsyncResult.cs
- MethodCallConverter.cs
- HtmlInputRadioButton.cs
- Rules.cs
- RequiredFieldValidator.cs
- Send.cs
- XDRSchema.cs
- DesignerCalendarAdapter.cs
- SHA256Managed.cs
- NameTable.cs
- BufferedGraphicsManager.cs
- TrackingServices.cs
- StringFunctions.cs
- AppSettingsExpressionEditor.cs
- ActivationServices.cs
- TrackingMemoryStream.cs
- SoapException.cs
- BuildProvidersCompiler.cs
- HostedHttpContext.cs
- LocationUpdates.cs
- SqlNotificationEventArgs.cs
- StrongNameUtility.cs
- HttpApplication.cs
- ImageCodecInfoPrivate.cs
- MessageContractMemberAttribute.cs
- ObjectListFieldCollection.cs
- DelimitedListTraceListener.cs
- UriTemplateTable.cs
- PropertyBuilder.cs
- TCPClient.cs
- DesignerAttribute.cs
- sortedlist.cs
- WorkflowRuntime.cs
- TabItem.cs
- Char.cs
- XmlBinaryReaderSession.cs
- FileCodeGroup.cs
- OptimizedTemplateContentHelper.cs
- SmiXetterAccessMap.cs
- BezierSegment.cs
- __ConsoleStream.cs
- BatchParser.cs
- IDQuery.cs
- PointConverter.cs
- SiteMapSection.cs
- ShaderRenderModeValidation.cs
- PrintControllerWithStatusDialog.cs
- Point3DKeyFrameCollection.cs
- TranslateTransform.cs
- ChineseLunisolarCalendar.cs