Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- HyperLink.cs
- GridViewAutomationPeer.cs
- OptimizerPatterns.cs
- HostedElements.cs
- Blend.cs
- ToolBar.cs
- AssertFilter.cs
- StringValidator.cs
- FunctionOverloadResolver.cs
- BamlRecordReader.cs
- Scene3D.cs
- bidPrivateBase.cs
- SHA1CryptoServiceProvider.cs
- Fx.cs
- ProxyWebPart.cs
- UserControlParser.cs
- MergeExecutor.cs
- PageFunction.cs
- HttpClientCertificate.cs
- RepeatButtonAutomationPeer.cs
- OverrideMode.cs
- SelectionEditingBehavior.cs
- TranslateTransform3D.cs
- PeerToPeerException.cs
- ServiceModelConfigurationSectionCollection.cs
- ServiceInstanceProvider.cs
- KnownBoxes.cs
- OracleEncoding.cs
- EpmHelper.cs
- FileDialogCustomPlaces.cs
- PackUriHelper.cs
- WhitespaceRule.cs
- RijndaelManaged.cs
- MemberMaps.cs
- RootBuilder.cs
- CodeNamespaceImport.cs
- JsonByteArrayDataContract.cs
- Rect3D.cs
- DataTableReader.cs
- TiffBitmapEncoder.cs
- Int64Animation.cs
- PolicyLevel.cs
- WebPartVerbCollection.cs
- OleDbParameter.cs
- QuaternionValueSerializer.cs
- Int32Rect.cs
- DataGridViewCellFormattingEventArgs.cs
- WebPartEditorApplyVerb.cs
- ProcessModelSection.cs
- EncoderExceptionFallback.cs
- SoundPlayer.cs
- AppDomainAttributes.cs
- VBIdentifierTrimConverter.cs
- AsyncMethodInvoker.cs
- HttpConfigurationContext.cs
- KeyGestureValueSerializer.cs
- GetBrowserTokenRequest.cs
- CqlBlock.cs
- PartialCachingControl.cs
- AccessViolationException.cs
- SqlDataSourceConfigureSelectPanel.cs
- SelectionRange.cs
- Point3DCollectionValueSerializer.cs
- ToolStripRendererSwitcher.cs
- ArcSegment.cs
- ComboBoxRenderer.cs
- _Rfc2616CacheValidators.cs
- DaylightTime.cs
- Atom10FormatterFactory.cs
- SearchForVirtualItemEventArgs.cs
- TraceContext.cs
- GridViewActionList.cs
- Matrix3D.cs
- Ops.cs
- FixedSOMPageConstructor.cs
- TypeExtension.cs
- CounterSample.cs
- PeerNameRegistration.cs
- DeadCharTextComposition.cs
- Converter.cs
- FileLogRecordHeader.cs
- RawStylusInputReport.cs
- InputBinder.cs
- xsdvalidator.cs
- SystemNetHelpers.cs
- XmlTextEncoder.cs
- IDispatchConstantAttribute.cs
- AssemblyInfo.cs
- DictionaryMarkupSerializer.cs
- FontCacheUtil.cs
- IRCollection.cs
- VectorCollection.cs
- MimeMapping.cs
- TokenBasedSet.cs
- WebPartDescription.cs
- ThicknessConverter.cs
- Accessors.cs
- FormsAuthenticationCredentials.cs
- ConnectionConsumerAttribute.cs
- MulticastNotSupportedException.cs