Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Net / System / Net / Sockets / MulticastOption.cs / 1305376 / MulticastOption.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Net.Sockets { using System.Net; ////// public class MulticastOption { IPAddress group; IPAddress localAddress; int ifIndex; ////// Contains option values /// for IP multicast packets. /// ////// public MulticastOption(IPAddress group, IPAddress mcint) { if (group == null) { throw new ArgumentNullException("group"); } if (mcint == null) { throw new ArgumentNullException("mcint"); } Group = group; LocalAddress = mcint; } public MulticastOption(IPAddress group, int interfaceIndex) { if (group == null) { throw new ArgumentNullException("group"); } if ( interfaceIndex < 0 || interfaceIndex > 0x00FFFFFF ) { throw new ArgumentOutOfRangeException("interfaceIndex"); } #if !FEATURE_PAL if (!ComNetOS.IsPostWin2K){ throw new PlatformNotSupportedException(SR.GetString(SR.WinXPRequired)); } #endif // !FEATURE_PAL Group = group; ifIndex = interfaceIndex; } ////// Creates a new instance of the MulticaseOption class with the specified IP /// address group and local address. /// ////// public MulticastOption(IPAddress group) { if (group == null) { throw new ArgumentNullException("group"); } Group = group; LocalAddress = IPAddress.Any; } ////// Creates a new version of the MulticastOption class for the specified /// group. /// ////// public IPAddress Group { get { return group; } set { group = value; } } ////// Sets the IP address of a multicast group. /// ////// public IPAddress LocalAddress { get { return localAddress; } set { ifIndex = 0; localAddress = value; } } public int InterfaceIndex { get { return ifIndex; } set { if ( value < 0 || value > 0x00FFFFFF ) { throw new ArgumentOutOfRangeException("value"); } #if !FEATURE_PAL if (!ComNetOS.IsPostWin2K){ throw new PlatformNotSupportedException(SR.GetString(SR.WinXPRequired)); } #endif // !FEATURE_PAL localAddress = null; ifIndex = value; } } } // class MulticastOption ////// Sets the local address of a multicast group. /// ////// public class IPv6MulticastOption { IPAddress m_Group; long m_Interface; ////// Contains option values for joining an IPv6 multicast group. /// ////// public IPv6MulticastOption(IPAddress group, long ifindex) { if (group == null) { throw new ArgumentNullException("group"); } if ( ifindex < 0 || ifindex > 0x00000000FFFFFFFF ) { throw new ArgumentOutOfRangeException("ifindex"); } Group = group; InterfaceIndex = ifindex; } ////// Creates a new instance of the MulticaseOption class with the specified IP /// address group and local address. /// ////// public IPv6MulticastOption(IPAddress group) { if (group == null) { throw new ArgumentNullException("group"); } Group = group; InterfaceIndex = 0; } ////// Creates a new version of the MulticastOption class for the specified /// group. /// ////// public IPAddress Group { get { return m_Group; } set { if (value == null) { throw new ArgumentNullException("value"); } m_Group = value; } } ////// Sets the IP address of a multicast group. /// ////// public long InterfaceIndex { get { return m_Interface; } set { if ( value < 0 || value > 0x00000000FFFFFFFF ) { throw new ArgumentOutOfRangeException("value"); } m_Interface = value; } } } // class MulticastOptionIPv6 } // namespace System.Net.Sockets // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ ///// Sets the interface index. /// ///// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Net.Sockets { using System.Net; ////// public class MulticastOption { IPAddress group; IPAddress localAddress; int ifIndex; ////// Contains option values /// for IP multicast packets. /// ////// public MulticastOption(IPAddress group, IPAddress mcint) { if (group == null) { throw new ArgumentNullException("group"); } if (mcint == null) { throw new ArgumentNullException("mcint"); } Group = group; LocalAddress = mcint; } public MulticastOption(IPAddress group, int interfaceIndex) { if (group == null) { throw new ArgumentNullException("group"); } if ( interfaceIndex < 0 || interfaceIndex > 0x00FFFFFF ) { throw new ArgumentOutOfRangeException("interfaceIndex"); } #if !FEATURE_PAL if (!ComNetOS.IsPostWin2K){ throw new PlatformNotSupportedException(SR.GetString(SR.WinXPRequired)); } #endif // !FEATURE_PAL Group = group; ifIndex = interfaceIndex; } ////// Creates a new instance of the MulticaseOption class with the specified IP /// address group and local address. /// ////// public MulticastOption(IPAddress group) { if (group == null) { throw new ArgumentNullException("group"); } Group = group; LocalAddress = IPAddress.Any; } ////// Creates a new version of the MulticastOption class for the specified /// group. /// ////// public IPAddress Group { get { return group; } set { group = value; } } ////// Sets the IP address of a multicast group. /// ////// public IPAddress LocalAddress { get { return localAddress; } set { ifIndex = 0; localAddress = value; } } public int InterfaceIndex { get { return ifIndex; } set { if ( value < 0 || value > 0x00FFFFFF ) { throw new ArgumentOutOfRangeException("value"); } #if !FEATURE_PAL if (!ComNetOS.IsPostWin2K){ throw new PlatformNotSupportedException(SR.GetString(SR.WinXPRequired)); } #endif // !FEATURE_PAL localAddress = null; ifIndex = value; } } } // class MulticastOption ////// Sets the local address of a multicast group. /// ////// public class IPv6MulticastOption { IPAddress m_Group; long m_Interface; ////// Contains option values for joining an IPv6 multicast group. /// ////// public IPv6MulticastOption(IPAddress group, long ifindex) { if (group == null) { throw new ArgumentNullException("group"); } if ( ifindex < 0 || ifindex > 0x00000000FFFFFFFF ) { throw new ArgumentOutOfRangeException("ifindex"); } Group = group; InterfaceIndex = ifindex; } ////// Creates a new instance of the MulticaseOption class with the specified IP /// address group and local address. /// ////// public IPv6MulticastOption(IPAddress group) { if (group == null) { throw new ArgumentNullException("group"); } Group = group; InterfaceIndex = 0; } ////// Creates a new version of the MulticastOption class for the specified /// group. /// ////// public IPAddress Group { get { return m_Group; } set { if (value == null) { throw new ArgumentNullException("value"); } m_Group = value; } } ////// Sets the IP address of a multicast group. /// ////// public long InterfaceIndex { get { return m_Interface; } set { if ( value < 0 || value > 0x00000000FFFFFFFF ) { throw new ArgumentOutOfRangeException("value"); } m_Interface = value; } } } // class MulticastOptionIPv6 } // namespace System.Net.Sockets // File provided for Reference Use Only by Microsoft Corporation (c) 2007./// Sets the interface index. /// ///
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- FixedSOMTable.cs
- SqlClientWrapperSmiStream.cs
- WebBrowserUriTypeConverter.cs
- ExpressionEditor.cs
- ExpressionBuilderCollection.cs
- SchemaConstraints.cs
- TimeSpanValidator.cs
- MonitorWrapper.cs
- WSDualHttpBinding.cs
- XmlReaderDelegator.cs
- Math.cs
- AttachedPropertyBrowsableAttribute.cs
- IntPtr.cs
- WebPartActionVerb.cs
- SQLInt32.cs
- FrugalList.cs
- FlowDocumentFormatter.cs
- SpeechDetectedEventArgs.cs
- CompositionTarget.cs
- MatchingStyle.cs
- TraceSection.cs
- WindowsGraphicsWrapper.cs
- UInt64Storage.cs
- CodeObject.cs
- RetrieveVirtualItemEventArgs.cs
- PictureBox.cs
- ProxyFragment.cs
- CodeBinaryOperatorExpression.cs
- ConnectionStringEditor.cs
- configsystem.cs
- DisposableCollectionWrapper.cs
- UnionExpr.cs
- DataProtection.cs
- NavigationCommands.cs
- CodeDOMProvider.cs
- ToRequest.cs
- ValueProviderWrapper.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- Registry.cs
- FunctionImportElement.cs
- ConfigurationLoaderException.cs
- Parser.cs
- TraceFilter.cs
- SafeRightsManagementQueryHandle.cs
- RequestQueue.cs
- AxWrapperGen.cs
- HiddenField.cs
- WebPartMovingEventArgs.cs
- SubstitutionList.cs
- dtdvalidator.cs
- WorkItem.cs
- RecognitionEventArgs.cs
- ContainerUIElement3D.cs
- HttpModuleCollection.cs
- SafeThemeHandle.cs
- GestureRecognizer.cs
- WpfKnownMember.cs
- XmlTextReader.cs
- XmlTypeMapping.cs
- WebBrowserNavigatedEventHandler.cs
- EventsTab.cs
- TrustLevel.cs
- HashAlgorithm.cs
- HttpContextWrapper.cs
- RelationshipEnd.cs
- FastEncoder.cs
- StrokeIntersection.cs
- ArglessEventHandlerProxy.cs
- DataGridViewCheckBoxCell.cs
- TypeToken.cs
- CharEntityEncoderFallback.cs
- HtmlHead.cs
- TriggerAction.cs
- DataGridViewTextBoxCell.cs
- ControlCollection.cs
- ServiceInfoCollection.cs
- ApplyImportsAction.cs
- Cloud.cs
- ToolboxBitmapAttribute.cs
- DataSourceProvider.cs
- XmlNotation.cs
- UiaCoreProviderApi.cs
- SQLDouble.cs
- ElementProxy.cs
- HttpProfileBase.cs
- X509CertificateStore.cs
- PointKeyFrameCollection.cs
- HtmlTableRow.cs
- DropTarget.cs
- CollectionMarkupSerializer.cs
- CatalogUtil.cs
- FreezableCollection.cs
- MimeTextImporter.cs
- Animatable.cs
- WebSysDisplayNameAttribute.cs
- PropertyDescriptor.cs
- DocumentPageTextView.cs
- BufferedStream2.cs
- OledbConnectionStringbuilder.cs
- MatrixIndependentAnimationStorage.cs