# Room: send() method

> The send() method of the Room interface sends a message to one connection.

The **`send()`** method of the [`Room`](/docs/reference/room-api/room) interface sends a message to one connection.

## Syntax

```ts
send(connection, message)
send(connection, message, options)
```

### Parameters

`connection`
: The connection to send to.

`message`
: The message to send. A `Uint8Array` is sent as a binary message, and anything else as JSON.

`options` Optional
: An object with this property:

  `unreliable`
  : A boolean. If `true`, the message is sent as a WebTransport datagram, or over WebSocket in order with stale ones dropped. Defaults to `false`.

### Return value

None (`undefined`).

### Exceptions

`RangeError`
: Thrown if the message is larger than 64 KB.

## Examples

### Answering one player

```ts
// ping.ts
import { defineRoom } from "@irtio/room";

export default defineRoom({
  onMessage(room, connection, message) {
    if (message === "ping") room.send(connection, "pong");
  },
});
```

## See also

- [`Room.broadcast()`](/docs/reference/room-api/room/broadcast)
- [Calls](/docs/guides/calls), for a message that needs a reply
