|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ClientChannel
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 ServerSession).
When the server adds a client session to a channel, the client's
ServerSessionListener's joinedChannel method is
invoked with that client channel, returning the client's
ClientChannelListener for the channel. A
ClientChannelListener for a client channel is notified
as follows:
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.leftChannel method is
invoked with the channel. Once a client has been removed
from a channel, that client can no longer send messages on that
channel.
| Method Summary | |
|---|---|
String |
getName()
Returns the name of this channel. |
void |
send(ByteBuffer message)
Sends the message contained in the specified ByteBuffer to
this channel. |
| Method Detail |
|---|
String getName()
void send(ByteBuffer message)
throws IOException
ByteBuffer to
this channel. The message starts at the buffer's current position
and ends at the buffer's limit. The buffer's position is not
modified by this operation.
If the server-side application does not filter messages on this
channel, the message will be delivered unaltered to all channel
members, including the sender. However, the server-side application
may alter the message, discard the message,
or modify the list of recipients for application-specific
reasons. If the channel message is not delivered to the sender
(because it is discarded by the application, for example), the
sender's ClientChannelListener will not receive a receivedMessage notification
for that message.
The ByteBuffer may be reused immediately after this method
returns. Changes made to the buffer after this method returns will
have no effect on the message sent to the channel by this invocation.
message - a message to send
IllegalStateException - if the sender is not a member of
this channel
IOException - if a synchronous I/O problem occurs
|
RedDwarf, Version 0.10.0 2010-02-12 09:11:07 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||