UdpSingleSourceMulticastClient Constructor
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Creates a new UdpSingleSourceMulticastClient UDP client that can subscribe to a group address and receive datagrams from a single source.
Assembly: System.Net (in System.Net.dll)
public UdpSingleSourceMulticastClient( IPAddress sourceAddress, IPAddress groupAddress, int localPort )
Parameters
- sourceAddress
- Type: System.Net.IPAddress
The sender source address for this receiver to subscribe to.
- groupAddress
- Type: System.Net.IPAddress
The multicast group address for this receiver to subscribe to.
- localPort
- Type: System.Int32
The local port for this receiver to bind to.
| Exception | Condition |
|---|---|
| ArgumentException | sourceAddress and groupAddress must be the same address family. |
| ArgumentNullException | sourceAddress is null. -or- groupAddress is null. |
| ArgumentOutOfRangeException | localPort is less than 0 -or- localPort is greater than 65,535. |
| SocketException | localPort is less than 1,024. |
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.