# RoomClient: asleep property

> The asleep read-only property of the RoomClient interface says whether the room sleeps while the router holds the client's connection.

The **`asleep`** read-only property of the [`RoomClient`](/docs/client/room-client) interface says whether the room is asleep: hibernated while the router holds the client's connection open.

## Value

A boolean. It's `true` from the [`sleep` event](/docs/client/room-client/sleep-event) until the room wakes or the connection drops, and `false` otherwise.

## Description

A room sleeps when its code calls [`room.hibernate({ keepConnections: true })`](/docs/room/room/hibernate). While it sleeps, the connection stays open and [`readyState`](/docs/client/room-client/readystate) stays `"open"`. Messages, calls and owner writes the client sends meanwhile wake the room and reach it after; unreliable messages and inputs are dropped. The client pings every 15 seconds instead of every 2.

When the room wakes, `asleep` is `false` again and the [`wake` event](/docs/client/room-client/wake-event) fires, once the client holds the room's full state.

## Examples

### Showing a sleeping board

A turn-based board game's room sleeps between moves. The client shows that the room is waiting, and the next move wakes it.

```ts
// board.ts
import { connect } from "@irtio/client";

const room = await connect("main");
const show = () => console.log(room.asleep ? "Waiting for the next move" : "Your move");
room.addEventListener("sleep", show);
room.addEventListener("wake", show);
show();
```

## See also

- [`sleep` event](/docs/client/room-client/sleep-event)
- [`Room.hibernate()`](/docs/room/room/hibernate), the room's side
- [Sleeping rooms](/docs/room/guides/hibernation#sleeping-rooms)
