Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / Net / System / Net / Sockets / _DisconnectOverlappedAsyncResult.cs / 1 / _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
- Label.cs
- SpanIndex.cs
- XmlJsonWriter.cs
- DbProviderServices.cs
- ScrollEvent.cs
- Root.cs
- WebBrowsableAttribute.cs
- LinearGradientBrush.cs
- DBPropSet.cs
- SelectionRangeConverter.cs
- AttachedPropertyBrowsableForChildrenAttribute.cs
- Rotation3DAnimationBase.cs
- PriorityRange.cs
- TextSelectionHighlightLayer.cs
- BrushConverter.cs
- PrivilegeNotHeldException.cs
- ButtonFieldBase.cs
- UrlMappingsSection.cs
- TypeToken.cs
- DataRelationCollection.cs
- ExtendedPropertyDescriptor.cs
- EncoderFallback.cs
- SmiTypedGetterSetter.cs
- BrowserDefinitionCollection.cs
- ExpressionPrinter.cs
- ExpandoObject.cs
- EditingCoordinator.cs
- TextRange.cs
- XmlSchemaAttribute.cs
- __ComObject.cs
- NamespaceListProperty.cs
- PointHitTestParameters.cs
- BitmapEffectDrawing.cs
- ErrorCodes.cs
- ExpressionParser.cs
- Calendar.cs
- AttributeAction.cs
- ApplicationSettingsBase.cs
- AttachedPropertyBrowsableForTypeAttribute.cs
- SqlConnectionPoolProviderInfo.cs
- UriTemplateVariableQueryValue.cs
- XmlSerializerSection.cs
- ToolStripDropDownClosingEventArgs.cs
- AppDomainResourcePerfCounters.cs
- WebPartHelpVerb.cs
- ScrollBar.cs
- XmlNodeChangedEventArgs.cs
- ScriptingRoleServiceSection.cs
- BuilderPropertyEntry.cs
- Point3DValueSerializer.cs
- DbParameterCollectionHelper.cs
- BufferModeSettings.cs
- SmtpFailedRecipientException.cs
- DataSet.cs
- XmlLoader.cs
- ContentHostHelper.cs
- Translator.cs
- EndpointDesigner.cs
- MouseCaptureWithinProperty.cs
- DetailsViewDeleteEventArgs.cs
- BuildProviderCollection.cs
- hebrewshape.cs
- ElementNotAvailableException.cs
- TargetControlTypeCache.cs
- RowTypeElement.cs
- PropertySet.cs
- WindowsPrincipal.cs
- COM2ICategorizePropertiesHandler.cs
- PageBuildProvider.cs
- CounterCreationDataCollection.cs
- WebEventTraceProvider.cs
- RequestQueue.cs
- SizeConverter.cs
- DataKeyArray.cs
- TextWriterTraceListener.cs
- EventMap.cs
- DynamicFilterExpression.cs
- SourceSwitch.cs
- InternalConfigSettingsFactory.cs
- ListControlDataBindingHandler.cs
- RawStylusSystemGestureInputReport.cs
- streamingZipPartStream.cs
- ISAPIWorkerRequest.cs
- AddInAdapter.cs
- UserControlAutomationPeer.cs
- TextEffect.cs
- FileInfo.cs
- DataRowComparer.cs
- DataObject.cs
- CodeArgumentReferenceExpression.cs
- UriTemplateMatch.cs
- AttachedPropertyMethodSelector.cs
- Quaternion.cs
- webclient.cs
- SmiEventSink_Default.cs
- DesignerForm.cs
- BindingExpressionBase.cs
- Size3D.cs
- Assembly.cs
- SchemaImporterExtension.cs