Represents a client's view of a channel. A channel is a communication group, consisting of multiple clients and the server.
The server is solely responsible for creating channels and adding and removing clients from channels. If desired, a client can request that a channel be created or its session be joined to or removed from the channel by sending an application-specific message to the server (using its {@link ServerSession}).
When the server adds a client session to a channel, the client's {@link ServerSessionListener}'s {@link ServerSessionListener#joinedChannel joinedChannel} method isinvoked with that client channel, returning the client's {@link ClientChannelListener} for the channel. A{@code ClientChannelListener} for a client channel is notifiedas follows:
- When a message is received on a client channel, the listener's {@link ClientChannelListener#receivedMessage receivedMessage}method is invoked with the channel and the message. The listener is notified of messages that its client sends on its associated channel; that is, a sender receives its own broadcasts.
- When the associated client leaves a channel, the listener's {@link ClientChannelListener#leftChannel leftChannel} method isinvoked with the channel. Once a client has been removed from a channel, that client can no longer send messages on that channel.