def test_recv_disconnect(self):
        ac = self.get_connected_handler()
        for errnum in pyftpdlib.ioloop._ERRNOS_DISCONNECTED:
            with mock.patch("pyftpdlib.ioloop.socket.socket.recv",
                            side_effect=socket.error(errnum, "")) as send:
                with mock.patch.object(ac, "handle_close") as handle_close:
                    self.assertEqual(ac.recv(b"x"), b'')
                    assert send.called
                    assert handle_close.called