Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / 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/// Sets the interface index. /// ///
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ComplexBindingPropertiesAttribute.cs
- FrameworkTemplate.cs
- FlowDocumentPaginator.cs
- ContentType.cs
- GeneralTransform.cs
- EmitterCache.cs
- SoapExtensionStream.cs
- X509Extension.cs
- HtmlShim.cs
- TextEncodedRawTextWriter.cs
- AdornerPresentationContext.cs
- LogWriteRestartAreaState.cs
- DockAndAnchorLayout.cs
- PolicyConversionContext.cs
- ChannelManagerService.cs
- EncodedStreamFactory.cs
- SearchExpression.cs
- NetPeerTcpBinding.cs
- TextRange.cs
- ServiceModelActivity.cs
- InfoCard.cs
- TextViewDesigner.cs
- ButtonStandardAdapter.cs
- GiveFeedbackEvent.cs
- WebPartsSection.cs
- RootBuilder.cs
- AttachmentCollection.cs
- ItemsPanelTemplate.cs
- SqlNode.cs
- Control.cs
- HtmlSelect.cs
- EmptyControlCollection.cs
- CompilerTypeWithParams.cs
- DataTableClearEvent.cs
- BaseTreeIterator.cs
- ObjectCacheSettings.cs
- DataGridViewLinkColumn.cs
- SafeNativeMethods.cs
- TagMapInfo.cs
- DataExpression.cs
- HttpResponseHeader.cs
- ClearCollection.cs
- LayoutTableCell.cs
- DrawingGroup.cs
- XmlSerializationGeneratedCode.cs
- DefaultAuthorizationContext.cs
- Deflater.cs
- FlowchartSizeFeature.cs
- SecureStringHasher.cs
- Utils.cs
- Utils.cs
- WindowsSpinner.cs
- DiagnosticTrace.cs
- RangeValidator.cs
- CodeParameterDeclarationExpressionCollection.cs
- SqlMultiplexer.cs
- XMLUtil.cs
- BindingBase.cs
- ListViewDeletedEventArgs.cs
- XhtmlBasicImageAdapter.cs
- ItemCheckEvent.cs
- ObjectDataSourceView.cs
- Matrix3D.cs
- HMACSHA1.cs
- Compilation.cs
- StickyNote.cs
- XmlDataCollection.cs
- ListManagerBindingsCollection.cs
- ForceCopyBuildProvider.cs
- ContentElementAutomationPeer.cs
- SecurityPolicySection.cs
- TemplateInstanceAttribute.cs
- TrackingSection.cs
- BindingManagerDataErrorEventArgs.cs
- WebPartEditVerb.cs
- ComponentManagerBroker.cs
- ItemTypeToolStripMenuItem.cs
- InvalidAsynchronousStateException.cs
- HtmlInputRadioButton.cs
- BrowserDefinitionCollection.cs
- ObjectDataSourceStatusEventArgs.cs
- Update.cs
- TypeSource.cs
- Rights.cs
- WebConfigurationFileMap.cs
- ImmutableObjectAttribute.cs
- ObjectDisposedException.cs
- WorkflowViewStateService.cs
- NumericUpDownAcceleration.cs
- EventsTab.cs
- StatusBarPanel.cs
- UriParserTemplates.cs
- NamespaceList.cs
- VisualTreeUtils.cs
- ScheduleChanges.cs
- IODescriptionAttribute.cs
- ListItemParagraph.cs
- VolatileEnlistmentMultiplexing.cs
- Baml2006KnownTypes.cs
- AffineTransform3D.cs