> For the complete documentation index, see [llms.txt](https://docs.servoy.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.servoy.com/reference/servoyextensions/server-plugins/clientmanager/broadcaster.md).

# Broadcaster

## Overview

The `Broadcaster` object facilitates real-time communication and message broadcasting to clients connected to the same channel, offering methods for message sending, channel management, and listener identification.

## Functionality

Broadcasters can send messages to all other listeners on their channel using the `broadcastMessage(message)` method. The object also allows retrieval of the channel's name via `getChannelName()` and the broadcaster's nickname using `getName()`. To clean up resources or stop listening, the `destroy()` method unregisters the broadcaster from the channel.

## Methods Summarized

| Type                                                     | Name                                                   | Summary                                                                                |
| -------------------------------------------------------- | ------------------------------------------------------ | -------------------------------------------------------------------------------------- |
| void                                                     | [broadcastMessage(message)](#broadcastmessage-message) | Sends a message to the all other listeners of the channel of this broadcaster.         |
| void                                                     | [destroy()](#destroy)                                  | Destroyes and unregister the listener for this channel.                                |
| [String](/reference/servoycore/dev-api/js-lib/string.md) | [getChannelName()](#getchannelname)                    | get the channel name where this broadcaster listens and sends messages to.             |
| [String](/reference/servoycore/dev-api/js-lib/string.md) | [getName()](#getname)                                  | Get the (nick) name for this broadcaster that will be send to other channel listeners. |

## Methods Detailed

### broadcastMessage(message)

Sends a message to the all other listeners of the channel of this broadcaster.

**Parameters**

* [String](/reference/servoycore/dev-api/js-lib/string.md) **message** The message to send to the other users of this channel

**Returns:** void

### destroy()

Destroyes and unregister the listener for this channel.

**Returns:** void

### getChannelName()

get the channel name where this broadcaster listens and sends messages to.

**Returns:** [String](/reference/servoycore/dev-api/js-lib/string.md) The channel name where this broadcaster listens and sends messages to.

### getName()

Get the (nick) name for this broadcaster that will be send to other channel listeners.

**Returns:** [String](/reference/servoycore/dev-api/js-lib/string.md) The (nick) name for this broadcaster that will be sent to other channel listeners

***


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.servoy.com/reference/servoyextensions/server-plugins/clientmanager/broadcaster.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
