public class OptimizedBroadcaster extends Object implements Broadcaster
Broadcaster optimized to send the same text to a set of
clients.
NOTE: works with DefaultWebSockets and inherited classes.| Constructor and Description |
|---|
OptimizedBroadcaster() |
| Modifier and Type | Method and Description |
|---|---|
void |
broadcast(Iterable<? extends WebSocket> recipients,
byte[] binary)
Broadcasts the provided binary content to the specified recipients.
|
void |
broadcast(Iterable<? extends WebSocket> recipients,
String text)
Broadcasts the provided text content to the specified recipients.
|
void |
broadcastFragment(Iterable<? extends WebSocket> recipients,
byte[] binary,
boolean last)
Broadcasts the provided fragmented binary content to the specified recipients.
|
void |
broadcastFragment(Iterable<? extends WebSocket> recipients,
String text,
boolean last)
Broadcasts the provided fragmented text content to the specified recipients.
|
public void broadcast(Iterable<? extends WebSocket> recipients, String text)
broadcast in interface Broadcasterrecipients - the recipients of the provided text content.text - textual content.public void broadcast(Iterable<? extends WebSocket> recipients, byte[] binary)
broadcast in interface Broadcasterrecipients - the recipients of the provided binary content.binary - binary content.public void broadcastFragment(Iterable<? extends WebSocket> recipients, String text, boolean last)
BroadcasterbroadcastFragment in interface Broadcasterrecipients - the recipients of the provided fragmented text content.text - fragmented textual content.last - true if this is the last fragment, otherwise false.public void broadcastFragment(Iterable<? extends WebSocket> recipients, byte[] binary, boolean last)
BroadcasterbroadcastFragment in interface Broadcasterrecipients - the recipients of the provided fragmented binary content.binary - fragmented binary content.last - true if this is the last fragment, otherwise false.Copyright © 2013 Oracle Corporation. All Rights Reserved.