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 | Sends a message to the all other listeners of the channel of this broadcaster. | |
void | Destroyes and unregister the listener for this channel. | |
get the channel name where this broadcaster listens and sends messages to. | ||
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 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 String
getName()
Get the (nick) name for this broadcaster that will be send to other channel listeners.
Returns: String String
Last updated