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

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- BamlMapTable.cs
- TextRangeSerialization.cs
- SafeThreadHandle.cs
- EdmToObjectNamespaceMap.cs
- ResourceSetExpression.cs
- BrowsableAttribute.cs
- TouchesCapturedWithinProperty.cs
- ColorKeyFrameCollection.cs
- Calendar.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- GPPOINT.cs
- ButtonChrome.cs
- XPathMultyIterator.cs
- ValidationHelper.cs
- WebServiceHandler.cs
- ToolStripDesignerUtils.cs
- MergeLocalizationDirectives.cs
- DataGridTableCollection.cs
- CodeSnippetCompileUnit.cs
- ACE.cs
- FreezableOperations.cs
- JpegBitmapDecoder.cs
- TcpClientCredentialType.cs
- XamlFigureLengthSerializer.cs
- BinaryParser.cs
- CreateParams.cs
- ViewManager.cs
- RowUpdatingEventArgs.cs
- RangeBaseAutomationPeer.cs
- SystemIcmpV4Statistics.cs
- AsymmetricKeyExchangeDeformatter.cs
- GeneralTransform3D.cs
- Point.cs
- ObjectStateEntryDbDataRecord.cs
- OperationFormatter.cs
- XmlSchemaObjectTable.cs
- PolyLineSegment.cs
- Accessors.cs
- WebPartConnectVerb.cs
- SearchForVirtualItemEventArgs.cs
- UserControl.cs
- HostExecutionContextManager.cs
- ImageSourceConverter.cs
- EntityPropertyMappingAttribute.cs
- SortDescriptionCollection.cs
- PreviewKeyDownEventArgs.cs
- StringReader.cs
- AttachmentCollection.cs
- CacheMemory.cs
- MetadataPropertyAttribute.cs
- Closure.cs
- Ipv6Element.cs
- DuplicateContext.cs
- ToolboxDataAttribute.cs
- Serializer.cs
- MobileFormsAuthentication.cs
- Rect.cs
- DbXmlEnabledProviderManifest.cs
- SQLInt64.cs
- SqlPersonalizationProvider.cs
- TcpProcessProtocolHandler.cs
- PropertyDescriptorCollection.cs
- SemanticKeyElement.cs
- CodeFieldReferenceExpression.cs
- SerializationInfo.cs
- TableLayoutPanelBehavior.cs
- NavigatorInput.cs
- XmlValidatingReader.cs
- KeyGesture.cs
- ExternalFile.cs
- DefaultPrintController.cs
- XmlConvert.cs
- Screen.cs
- FixUp.cs
- VectorCollectionValueSerializer.cs
- HttpListenerTimeoutManager.cs
- ImageListStreamer.cs
- ObjectDataSourceDisposingEventArgs.cs
- ConfigurationProviderException.cs
- FileSystemEventArgs.cs
- PropertyInfoSet.cs
- SystemInformation.cs
- BoundPropertyEntry.cs
- RotateTransform3D.cs
- RegistryConfigurationProvider.cs
- EventRecordWrittenEventArgs.cs
- ApplicationCommands.cs
- CheckPair.cs
- SimpleRecyclingCache.cs
- RootAction.cs
- StorageEndPropertyMapping.cs
- PropertyNames.cs
- BaseCodePageEncoding.cs
- CodeDOMUtility.cs
- MemberMaps.cs
- RuleSettings.cs
- SignedPkcs7.cs
- StylusEventArgs.cs
- InheritanceContextChangedEventManager.cs
- WpfPayload.cs