# RoomClient: connection property

> The connection read-only property of the RoomClient interface is the ID of the client's current connection to the room.

The **`connection`** read-only property of the [`RoomClient`](/docs/client/room-client) interface is the ID of the client's current connection to the room.

## Value

A number, the connection's [`id`](/docs/room/connection/id) in the room. It's `0` until the router accepts the first connection.

## Description

The ID belongs to the connection, not to the player. After a reconnect, and when a sleeping room wakes, the client has a new connection with a new ID. To name the player across connections, use [`player`](/docs/client/room-client/player).

## Examples

### Tagging log lines with the connection

When the room logs connection IDs, a client that tags its own logs the same way can be matched with them.

```ts
// log.ts
import type { RoomClient } from "@irtio/client";

export function log(room: RoomClient, line: string): void {
  console.log(`[${room.id}#${room.connection}] ${line}`);
}
```

## See also

- [`RoomClient.player`](/docs/client/room-client/player)
- [`Connection.id`](/docs/room/connection/id)
