System.Net.Sockets.Tests.DualModeConnectionlessReceiveFrom.Socket_ReceiveFromV4IPEndPointFromV4Client_Throws C# (CSharp) Метод

Socket_ReceiveFromV4IPEndPointFromV4Client_Throws() приватный Метод

private Socket_ReceiveFromV4IPEndPointFromV4Client_Throws ( ) : void
Результат void
        public void Socket_ReceiveFromV4IPEndPointFromV4Client_Throws()
        {
            // "The supplied EndPoint of AddressFamily InterNetwork is not valid for this Socket, use InterNetworkV6 instead."
            Socket socket = new Socket(SocketType.Dgram, ProtocolType.Udp);
            socket.DualMode = false;

            EndPoint receivedFrom = new IPEndPoint(IPAddress.Loopback, UnusedPort);
            Assert.Throws<ArgumentException>(() =>
            {
                int received = socket.ReceiveFrom(new byte[1], ref receivedFrom);
            });
        }