async def METHOD_NAME(simple_server, client_connection):
    async def close_connection():
        await asyncio.sleep(2)
        await client_connection.close_websocket_connection()
    listener = await ws_listen(client_connection)
    assert client_connection.ws_connected
    ensure_future(close_connection())
    with pytest.raises(HmipConnectionError):
        await listener
    assert client_connection.ping_pong_task.done()
    assert client_connection.ws_reader_task.done()
    assert not client_connection.ws_connected
    # Now try to reconnect again.
    listener = await ws_listen(client_connection)
    assert client_connection.ws_connected
    ensure_future(close_connection())
    with pytest.raises(HmipConnectionError):
        await listener