Пример #1
0
        public void SendMoreThanMTUDroppedOnReceiveByThreadSock()
        {
            var bufferPool = new ByteBufferPool();
            var sock       = new ThreadSock(bufferPool, AddressFamily.InterNetwork, new LoggerStub());

            sock.Listen(23460);

            UdpClient udpClient = new UdpClient();

            udpClient.Connect(IPAddress.Loopback, 23460);
            udpClient.Send(new byte[BareSock.MTU + 1], BareSock.MTU + 1);

            var receivedPacket = Utils.WaitOnReceive(sock);

            Assert.IsNull(receivedPacket.Buffer);
            Assert.AreEqual(0, receivedPacket.Offset);
            Assert.AreEqual(0, receivedPacket.Length);

            sock.Close();
        }
Пример #2
0
 public void TearDown()
 {
     _sock.Close();
 }