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
- OdbcInfoMessageEvent.cs
- LiteralSubsegment.cs
- FormViewUpdateEventArgs.cs
- ProgramNode.cs
- XmlSchemaNotation.cs
- ECDiffieHellmanPublicKey.cs
- GridEntry.cs
- XmlDataImplementation.cs
- CompoundFileStorageReference.cs
- TypeUsage.cs
- BinaryObjectWriter.cs
- RightNameExpirationInfoPair.cs
- HtmlInputReset.cs
- RuntimeCompatibilityAttribute.cs
- MdiWindowListStrip.cs
- MobileCategoryAttribute.cs
- Win32Exception.cs
- CodeNamespace.cs
- XmlSchemaValidator.cs
- EastAsianLunisolarCalendar.cs
- CompiledIdentityConstraint.cs
- SystemIcmpV4Statistics.cs
- BaseAppDomainProtocolHandler.cs
- BamlLocalizationDictionary.cs
- Stack.cs
- TypeDependencyAttribute.cs
- NullableFloatSumAggregationOperator.cs
- OracleConnection.cs
- ItemDragEvent.cs
- CSharpCodeProvider.cs
- KnownBoxes.cs
- XmlDocumentFragment.cs
- HashSet.cs
- NativeWindow.cs
- TypeFieldSchema.cs
- Oid.cs
- ManipulationBoundaryFeedbackEventArgs.cs
- SHA256.cs
- SqlProvider.cs
- SqlProfileProvider.cs
- PropertyMapper.cs
- TypeSchema.cs
- Cursor.cs
- SortedDictionary.cs
- MimeReturn.cs
- LockedHandleGlyph.cs
- BitmapMetadataBlob.cs
- RangeValuePattern.cs
- ImageSource.cs
- PolicyUnit.cs
- XmlAttribute.cs
- HtmlInputCheckBox.cs
- XmlSchemaAnyAttribute.cs
- LinkedList.cs
- SchemaEntity.cs
- _WebProxyDataBuilder.cs
- FrameworkRichTextComposition.cs
- DataGridViewDataErrorEventArgs.cs
- Setter.cs
- IntellisenseTextBox.designer.cs
- SyndicationContent.cs
- InvokeMethodDesigner.xaml.cs
- WebPartConnectionsEventArgs.cs
- ZipIOExtraFieldPaddingElement.cs
- String.cs
- SmtpFailedRecipientsException.cs
- StorageComplexPropertyMapping.cs
- DataObjectPastingEventArgs.cs
- String.cs
- WindowsAuthenticationEventArgs.cs
- Assembly.cs
- QilBinary.cs
- ApplicationFileCodeDomTreeGenerator.cs
- WmpBitmapEncoder.cs
- BaseTypeViewSchema.cs
- ProxyRpc.cs
- QueueProcessor.cs
- HotSpotCollection.cs
- TypefaceCollection.cs
- sqlser.cs
- RootProjectionNode.cs
- MetadataProperty.cs
- HttpListenerException.cs
- SystemIPGlobalProperties.cs
- DataGridViewLinkCell.cs
- ClientScriptItem.cs
- WebPartVerbCollection.cs
- InputScopeAttribute.cs
- GridViewPageEventArgs.cs
- ItemCollection.cs
- LayoutEditorPart.cs
- TextTreeUndoUnit.cs
- SqlVisitor.cs
- BaseCollection.cs
- CacheManager.cs
- RuntimeResourceSet.cs
- CorrelationManager.cs
- FixedTextPointer.cs
- TransactionalPackage.cs
- DataKeyArray.cs