Muokkaa

Jaa


UdpSingleSourceMulticastClient(IPAddress, IPAddress, Int32) Constructor

Definition

Caution

This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.

Creates a new UdpSingleSourceMulticastClient UDP client that can subscribe to a group address and receive datagrams from a single source.

public:
 UdpSingleSourceMulticastClient(System::Net::IPAddress ^ sourceAddress, System::Net::IPAddress ^ groupAddress, int localPort);
[System.Obsolete("This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.", true)]
public UdpSingleSourceMulticastClient (System.Net.IPAddress sourceAddress, System.Net.IPAddress groupAddress, int localPort);
[<System.Obsolete("This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.", true)>]
new System.Net.Sockets.UdpSingleSourceMulticastClient : System.Net.IPAddress * System.Net.IPAddress * int -> System.Net.Sockets.UdpSingleSourceMulticastClient
Public Sub New (sourceAddress As IPAddress, groupAddress As IPAddress, localPort As Integer)

Parameters

sourceAddress
IPAddress

The sender source address for this receiver to subscribe to.

groupAddress
IPAddress

The multicast group address for this receiver to subscribe to.

localPort
Int32

The local port for this receiver to bind to.

Attributes

Exceptions

sourceAddress and groupAddress must be the same address family.

sourceAddress is a null reference (Nothing in Visual Basic).

-or-

groupAddress is a null reference (Nothing in Visual Basic).

localPort is less than 0

-or-

localPort is greater than 65,535.

localPort is less than 1024

Remarks

The UdpSingleSourceMulticastClient constructor associates a UDP multicast socket with a group address and port, but does not bind or otherwise use the socket.

The groupAddress parameter may be either an IPv6 or IPv4 multicast address. However, the address family of the sourceAddress and groupAddress parameters must the same.

The localPort parameter must not specify a port less than 1,024.

Applies to