Home
Discussion Forums
Tutorials & Source Code
Developer Blogs
Developer Events
Developer Jobs
Labs
We need you!
We're working hard on the next version of Developer Fusion -
Let us know
what you think we should be up to!
The Labs
\
Source Viewer
\
SSCLI
\
System.Net.Sockets
\ IPv6MulticastOption
Object Browser
Solution Explorer
SSCLI
Expand
Microsoft.Win32
Expand
Microsoft.Win32.SafeHandles
Expand
System
Expand
System.Runtime.Hosting
Expand
System.Runtime.InteropServices
Expand
System.Runtime.CompilerServices
Expand
System.Collections
Expand
System.Collections.Generic
Expand
System.Collections.ObjectModel
Expand
System.Configuration.Assemblies
Expand
System.Diagnostics
Expand
System.Diagnostics.CodeAnalysis
Expand
System.Diagnostics.SymbolStore
Expand
System.Globalization
Expand
System.IO
Expand
System.IO.IsolatedStorage
Expand
System.Reflection
Expand
System.Reflection.Cache
Expand
System.Reflection.Emit
Expand
System.Resources
Expand
System.Runtime
Expand
System.Runtime.InteropServices.Expando
Expand
System.Runtime.ConstrainedExecution
Expand
System.Runtime.Remoting.Activation
Expand
System.Runtime.Remoting.Messaging
Expand
System.Runtime.Remoting.Channels
Expand
System.Runtime.Remoting.Lifetime
Expand
System.Runtime.Remoting
Expand
System.Runtime.Remoting.Contexts
Expand
System.Runtime.Remoting.Proxies
Expand
System.Runtime.Remoting.Metadata
Expand
System.Runtime.Remoting.Metadata.W3cXsd2001
Expand
System.Runtime.Remoting.Services
Expand
System.Runtime.Serialization
Expand
System.Runtime.Serialization.Formatters
Expand
System.Runtime.Serialization.Formatters.Binary
Expand
System.Runtime.Versioning
Expand
System.Security
Expand
System.Security.Cryptography
Expand
System.Security.Cryptography.X509Certificates
Expand
System.Security.Permissions
Expand
System.Security.Policy
Expand
System.Security.Principal
Expand
System.Security.Util
Expand
System.Text
Expand
System.Threading
Expand
System.Runtime.Remoting.Channels.Http
Expand
System.Runtime.Remoting.Channels.Tcp
Expand
System.Runtime.Remoting.MetadataServices
Expand
System.Runtime.Serialization.Formatters.Soap.Xml
Expand
System.Runtime.Serialization.Formatters.Soap
Expand
Microsoft.Tools.Caspol
Expand
Microsoft.Tools.Build
Expand
Microsoft.CSharp
Expand
System.CodeDom
Expand
System.CodeDom.Compiler
Expand
System.Collections.Specialized
Expand
System.ComponentModel
Expand
System.ComponentModel.Design
Expand
System.ComponentModel.Design.Serialization
Expand
System.Configuration
Expand
System.Web
Expand
System.Configuration.Provider
Expand
System.Configuration.Internal
Expand
System.Internal
Expand
System.Windows.Forms
Expand
System.Net
Expand
System.Net.Sockets
Expand
AcceptAsyncResult
Expand
AcceptOverlappedAsyncResult
Expand
AddressFamily
Expand
AsyncEventBits
Expand
AsyncEventBitsPos
Expand
BaseOverlappedAsyncResult
Expand
CacheSet
Expand
ConnectAsyncResult
Expand
ConnectOverlappedAsyncResult
Expand
DisconnectOverlappedAsyncResult
Expand
DownLevelSendFileAsyncResult
Expand
IOControlCode
Expand
IoctlSocketConstants
Expand
IPPacketInformation
Expand
IPv6MulticastOption
Group()
InterfaceIndex()
IPv6MulticastOption(IPAddress)
IPv6MulticastOption(IPAddress, long)
Expand
LingerOption
Expand
MulticastOption
Expand
MultipleAddressConnectAsyncResult
Expand
NetworkEvents
Expand
NetworkStream
Expand
OverlappedAsyncResult
Expand
OverlappedCache
Expand
ProtocolFamily
Expand
ProtocolType
Expand
ReceiveMessageOverlappedAsyncResult
Expand
SelectMode
Expand
Socket
Expand
SocketError
Expand
SocketException
Expand
SocketFlags
Expand
SocketInformation
Expand
SocketInformationOptions
Expand
SocketOptionLevel
Expand
SocketOptionName
Expand
SocketShutdown
Expand
SocketType
Expand
TcpClient
Expand
TcpListener
Expand
TimeValue
Expand
TransmitFileOptions
Expand
TransmitFileOverlappedAsyncResult
Expand
UdpClient
Expand
System.Net.NetworkInformation
Expand
System.Net.ComImports
Expand
System.Net.Security
Expand
System.Net.Cache
Expand
System.Net.Configuration
Expand
System.Text.RegularExpressions
Expand
System.Tools
Expand
System.IO.Compression
Expand
System.IO.Ports
Expand
System.Security.AccessControl
Expand
System.Xml
Expand
System.Xml.XPath.DataBinding
Expand
System.Xml.Schema
Expand
System.Xml.Serialization
Expand
System.Xml.Serialization.Advanced
Expand
System.Xml.Serialization.Configuration
Expand
System.Xml.XPath
Expand
System.Xml.Xsl
Expand
System.Xml.Xsl.IlGen
Expand
System.Xml.Xsl.Qil
Expand
System.Xml.Xsl.Runtime
Expand
System.Xml.Xsl.XPath
Expand
System.Xml.Xsl.Xslt
Expand
System.Xml.Xsl.XsltOld
Expand
System.Xml.Xsl.XsltOld.Debugger
Expand
Microsoft.JScript
Expand
Microsoft.Vsa
Expand
Microsoft.JScript.Vsa
C#
VB.NET
//------------------------------------------------------------------------------
// <copyright file="MulticastOption.cs" company="Microsoft">
//
// Copyright (c) 2006 Microsoft Corporation. All rights reserved.
//
// The use and distribution terms for this software are contained in the file
// named license.txt, which can be found in the root of this distribution.
// By using this software in any fashion, you are agreeing to be bound by the
// terms of this license.
//
// You must not remove this notice, or any other, from this software.
//
// </copyright>
//------------------------------------------------------------------------------
namespace
System.Net.Sockets
{
using
System.Net
;
/// <devdoc>
/// <para>
/// Contains option values
/// for IP multicast packets.
/// </para>
/// </devdoc>
public
class
MulticastOption
{
IPAddress
group;
IPAddress
localAddress;
int
ifIndex;
/// <devdoc>
/// <para>
/// Creates a new instance of the MulticaseOption class with the specified IP
/// address group and local address.
/// </para>
/// </devdoc>
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 > 16777215) {
throw
new
ArgumentOutOfRangeException
("interfaceIndex");
}
Group = group;
ifIndex = interfaceIndex;
}
/// <devdoc>
/// <para>
/// Creates a new version of the MulticastOption class for the specified
/// group.
/// </para>
/// </devdoc>
public
MulticastOption(
IPAddress
group)
{
if
(group ==
null
) {
throw
new
ArgumentNullException
("group");
}
Group = group;
LocalAddress = IPAddress.Any;
}
/// <devdoc>
/// <para>
/// Sets the IP address of a multicast group.
/// </para>
/// </devdoc>
public
IPAddress
Group {
get {
return
group; }
set { group = value; }
}
/// <devdoc>
/// <para>
/// Sets the local address of a multicast group.
/// </para>
/// </devdoc>
public
IPAddress
LocalAddress {
get {
return
localAddress; }
set {
ifIndex = 0;
localAddress = value;
}
}
public
int
InterfaceIndex {
get {
return
ifIndex; }
set {
if
(value < 0 || value > 16777215) {
throw
new
ArgumentOutOfRangeException
("value");
}
localAddress =
null
;
ifIndex = value;
}
}
}
// class MulticastOption
/// <devdoc>
/// <para>
/// Contains option values for joining an IPv6 multicast group.
/// </para>
/// </devdoc>
public
class
IPv6MulticastOption
{
IPAddress
m_Group;
long
m_Interface;
/// <devdoc>
/// <para>
/// Creates a new instance of the MulticaseOption class with the specified IP
/// address group and local address.
/// </para>
/// </devdoc>
public
IPv6MulticastOption(
IPAddress
group,
long
ifindex)
{
if
(group ==
null
) {
throw
new
ArgumentNullException
("group");
}
if
(ifindex < 0 || ifindex > 4294967295u) {
throw
new
ArgumentOutOfRangeException
("ifindex");
}
Group = group;
InterfaceIndex = ifindex;
}
/// <devdoc>
/// <para>
/// Creates a new version of the MulticastOption class for the specified
/// group.
/// </para>
/// </devdoc>
public
IPv6MulticastOption(
IPAddress
group)
{
if
(group ==
null
) {
throw
new
ArgumentNullException
("group");
}
Group = group;
InterfaceIndex = 0;
}
/// <devdoc>
/// <para>
/// Sets the IP address of a multicast group.
/// </para>
/// </devdoc>
public
IPAddress
Group {
get {
return
m_Group; }
set {
if
(value ==
null
) {
throw
new
ArgumentNullException
("value");
}
m_Group = value;
}
}
/// <devdoc>
/// <para>
/// Sets the interface index.
/// </para>
/// </devdoc>
public
long
InterfaceIndex {
get {
return
m_Interface; }
set {
if
(value < 0 || value > 4294967295u) {
throw
new
ArgumentOutOfRangeException
("value");
}
m_Interface = value;
}
}
}
// class MulticastOptionIPv6
}
// namespace System.Net.Sockets
Developer Fusion