public void ReceiveFrom_NotSupported()
{
using (Socket sock = new Socket(SocketType.Dgram, ProtocolType.Udp))
{
EndPoint ep = new IPEndPoint(IPAddress.Any, 0);
sock.Bind(ep);
byte[] buf = new byte[1];
Assert.Throws<PlatformNotSupportedException>(() => sock.ReceiveFrom(buf, ref ep));
Assert.Throws<PlatformNotSupportedException>(() => sock.ReceiveFrom(buf, SocketFlags.None, ref ep));
Assert.Throws<PlatformNotSupportedException>(() => sock.ReceiveFrom(buf, buf.Length, SocketFlags.None, ref ep));
Assert.Throws<PlatformNotSupportedException>(() => sock.ReceiveFrom(buf, 0, buf.Length, SocketFlags.None, ref ep));
}
}
}