UdpClient.MulticastLoopback 属性
定义
public:
property bool MulticastLoopback { bool get(); void set(bool value); };
public bool MulticastLoopback { get; set; }
member this.MulticastLoopback : bool with get, set
Public Property MulticastLoopback As Boolean
属性值
如果 UdpClient 接收传出的多路广播数据包,则为 true;否则为 false。true if the UdpClient receives outgoing multicast packets; otherwise, false.
示例
下面的代码示例演示属性的用法 MulticastLoopback 。The following code example shows the use of the MulticastLoopback property.
static void GetSetMulticastLoopback( UdpClient^ u )
{
// Deliver multicast packets back to the sending client.
u->MulticastLoopback = true;
Console::WriteLine( "MulticastLoopback value is {0}", u->MulticastLoopback );
}
public static void GetSetMulticastLoopback(UdpClient u)
{
// Deliver multicast packets back to the sending client.
u.MulticastLoopback = true;
Console.WriteLine("MulticastLoopback value is {0}",
u.MulticastLoopback);
}
注解
多播是 Internet 上多对多通信的可扩展方法。Multicast is a scalable method for many-to-many communication on the Internet. 如果某个进程订阅了多播地址,则该进程发送的任何数据包都将由每个已订阅多路广播地址的进程接收。If a process subscribes to a multicast address, any packets sent by that process are received by every other process that has subscribed to the multicast address.