Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Net / System / Net / NetworkInformation / TeredoHelper.cs / 1305376 / TeredoHelper.cs
using System.Collections.Generic; using System.ComponentModel; using System.Net.Sockets; using System.Runtime.InteropServices; using System.Security; using System.Threading; namespace System.Net.NetworkInformation { // This class wraps the native API NotifyStableUnicastIpAddressTable. The native function's behavior is: // // 1. If the address table is already stable, it returns ERROR_SUCCESS and a Mib table handle that we must free. // The passed-in callback will never be called, and the cancelHandle is set to NULL. // // 2. If the address table is not stable, it returns ERROR_IO_PENDING. The table handle is set to NULL, // and the cancelHandle is set to a valid handle. The callback will be called (on a native threadpool thread) // EVERY TIME the address table becomes stable until CancelMibChangeNotify2 is called on the cancelHandle // (via cancelHandle.Dispose()). // // CancelMibChangeNotify2 guarantees that, by the time it returns, all calls to the callback will be complete // and that no new calls to the callback will be issued. // // The major concerns of the class are: 1) making sure none of the managed objects needed to handle a native // callback are GC'd before the callback, and 2) making sure no native callbacks will try to call into an unloaded // AppDomain. [SuppressUnmanagedCodeSecurity] internal class TeredoHelper { // Holds a list of all pending calls to NotifyStableUnicastIpAddressTable. Also used as a lock to protect its // contents and impendingAppDomainUnload. private static ListpendingNotifications; // Flag that gets set when an AppDomain unload is imminent. When this is set, no more calls to // NotifyStableUnicastIpAddressTable are allowed. private static bool impendingAppDomainUnload; private readonly Action
Link Menu
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CurrentTimeZone.cs
- SerialReceived.cs
- GridToolTip.cs
- InvalidStoreProtectionKeyException.cs
- PersianCalendar.cs
- BoolExpressionVisitors.cs
- HandleRef.cs
- SecurityException.cs
- GPPOINTF.cs
- PersistenceContextEnlistment.cs
- ClientApiGenerator.cs
- HtmlMeta.cs
- RenderContext.cs
- ReferencedAssemblyResolver.cs
- MouseActionConverter.cs
- RectKeyFrameCollection.cs
- PermissionRequestEvidence.cs
- VisualTreeUtils.cs
- CTreeGenerator.cs
- DispatcherExceptionFilterEventArgs.cs
- Debug.cs
- XsdDateTime.cs
- CodeDomConfigurationHandler.cs
- followingquery.cs
- SoapSchemaMember.cs
- PrintDialog.cs
- StyleTypedPropertyAttribute.cs
- GridEntryCollection.cs
- WindowPatternIdentifiers.cs
- LoadedOrUnloadedOperation.cs
- EntryPointNotFoundException.cs
- Variant.cs
- loginstatus.cs
- Authorization.cs
- tooltip.cs
- SparseMemoryStream.cs
- MetadataWorkspace.cs
- _Win32.cs
- AsymmetricSignatureDeformatter.cs
- TraceContextEventArgs.cs
- AppSettingsSection.cs
- webproxy.cs
- TCPClient.cs
- KeyInterop.cs
- ObjectDataSourceFilteringEventArgs.cs
- ErasingStroke.cs
- WriterOutput.cs
- XmlSchemaAppInfo.cs
- ColorPalette.cs
- StackSpiller.cs
- FamilyCollection.cs
- DataContractSerializerSection.cs
- DateRangeEvent.cs
- GridViewCancelEditEventArgs.cs
- RecognizedWordUnit.cs
- EntityParameter.cs
- Triplet.cs
- MonthChangedEventArgs.cs
- NegotiationTokenAuthenticator.cs
- LayoutTableCell.cs
- ContentPropertyAttribute.cs
- TcpHostedTransportConfiguration.cs
- SymbolType.cs
- IPGlobalProperties.cs
- ObjectDataSourceStatusEventArgs.cs
- LoginView.cs
- RepeaterItemCollection.cs
- XmlLangPropertyAttribute.cs
- AttributeUsageAttribute.cs
- DependencyObjectType.cs
- WpfSharedXamlSchemaContext.cs
- SchemaNamespaceManager.cs
- TextMarkerSource.cs
- RuleDefinitions.cs
- ObjRef.cs
- MasterPage.cs
- ReliableChannelBinder.cs
- ToolBarDesigner.cs
- WebPartCatalogCloseVerb.cs
- RoleGroupCollection.cs
- ManipulationCompletedEventArgs.cs
- GPRECTF.cs
- StyleBamlRecordReader.cs
- TextServicesLoader.cs
- DataGridViewCellValueEventArgs.cs
- InvokeMethodActivityDesigner.cs
- Exceptions.cs
- WebPartDeleteVerb.cs
- DBBindings.cs
- TextOnlyOutput.cs
- FontStyleConverter.cs
- WebControl.cs
- CriticalHandle.cs
- AssociatedControlConverter.cs
- ObjectIDGenerator.cs
- MessagingActivityHelper.cs
- MouseActionValueSerializer.cs
- BufferBuilder.cs
- ListViewItem.cs
- EnumConverter.cs