Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / Net / System / Net / Sockets / MulticastOption.cs / 1 / 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
- DoubleAnimationClockResource.cs
- TreeViewEvent.cs
- DeploymentSectionCache.cs
- MouseActionConverter.cs
- ConfigXmlText.cs
- DelegateOutArgument.cs
- DoubleLink.cs
- BooleanToSelectiveScrollingOrientationConverter.cs
- OpenFileDialog.cs
- XmlTextReaderImpl.cs
- DataControlPagerLinkButton.cs
- SamlAuthorizationDecisionStatement.cs
- OleDbStruct.cs
- XPathCompileException.cs
- WebBrowser.cs
- BStrWrapper.cs
- ProxyAttribute.cs
- DbBuffer.cs
- InternalEnumValidatorAttribute.cs
- TreeNodeStyle.cs
- DefaultPrintController.cs
- RubberbandSelector.cs
- Page.cs
- Thickness.cs
- TagMapInfo.cs
- SqlRewriteScalarSubqueries.cs
- SkipQueryOptionExpression.cs
- HScrollProperties.cs
- BulletedListEventArgs.cs
- ComPlusThreadInitializer.cs
- DateTimeFormatInfo.cs
- WeakEventManager.cs
- VariableDesigner.xaml.cs
- ProxySimple.cs
- ActivityExecutorOperation.cs
- HttpRequestCacheValidator.cs
- AssemblyInfo.cs
- GridViewUpdatedEventArgs.cs
- Condition.cs
- TextContainerChangeEventArgs.cs
- WebSysDescriptionAttribute.cs
- QueueException.cs
- ObjectStateEntryOriginalDbUpdatableDataRecord.cs
- TextTreeInsertElementUndoUnit.cs
- XmlReturnWriter.cs
- EarlyBoundInfo.cs
- TriggerAction.cs
- XsltLoader.cs
- StringConverter.cs
- IdleTimeoutMonitor.cs
- XmlSchemaObjectTable.cs
- RsaSecurityTokenAuthenticator.cs
- FixedSOMTableRow.cs
- DefinitionBase.cs
- ContentControl.cs
- SafeIUnknown.cs
- ReversePositionQuery.cs
- DynamicFilterExpression.cs
- AppDomainShutdownMonitor.cs
- TreeNodeSelectionProcessor.cs
- Utils.cs
- SimpleBitVector32.cs
- TemplateAction.cs
- SqlDesignerDataSourceView.cs
- LineUtil.cs
- XmlChoiceIdentifierAttribute.cs
- OptimalBreakSession.cs
- VBIdentifierName.cs
- CharUnicodeInfo.cs
- HtmlInputControl.cs
- XmlDataSourceNodeDescriptor.cs
- QueryOutputWriter.cs
- MimeWriter.cs
- Visitors.cs
- StylusPointDescription.cs
- ZipIOExtraFieldElement.cs
- RegexCharClass.cs
- GenericTypeParameterBuilder.cs
- BCryptSafeHandles.cs
- Propagator.ExtentPlaceholderCreator.cs
- SchemaImporterExtensionElement.cs
- Int16Animation.cs
- ImageField.cs
- TrackingDataItem.cs
- DuplicateDetector.cs
- mediapermission.cs
- LayoutEvent.cs
- FixedTextPointer.cs
- EntityDataSourceReferenceGroup.cs
- LayoutTableCell.cs
- WebHeaderCollection.cs
- ResourceIDHelper.cs
- RelationHandler.cs
- ShutDownListener.cs
- ActivityInterfaces.cs
- ThousandthOfEmRealDoubles.cs
- XmlEncoding.cs
- IncrementalCompileAnalyzer.cs
- DeploymentSectionCache.cs
- ToolStripTextBox.cs