public UdpClient(IPEndPoint localEP)
{
// Validate input parameters.
if (localEP == null)
{
throw new ArgumentNullException(nameof(localEP));
}
// IPv6 Changes: Set the AddressFamily of this object before
// creating the client socket.
_family = localEP.AddressFamily;
CreateClientSocket();
_clientSocket.Bind(localEP);
}