public class OptimizedBroadcaster extends Object implements Broadcaster
Broadcaster
optimized to send the same text to a set of
clients.
NOTE: works with DefaultWebSocket
s 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 Broadcaster
recipients
- the recipients of the provided text content.text
- textual content.public void broadcast(Iterable<? extends WebSocket> recipients, byte[] binary)
broadcast
in interface Broadcaster
recipients
- the recipients of the provided binary content.binary
- binary content.public void broadcastFragment(Iterable<? extends WebSocket> recipients, String text, boolean last)
Broadcaster
broadcastFragment
in interface Broadcaster
recipients
- 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)
Broadcaster
broadcastFragment
in interface Broadcaster
recipients
- the recipients of the provided fragmented binary content.binary
- fragmented binary content.last
- true if this is the last fragment, otherwise false.Copyright © 2015 Oracle Corporation. All rights reserved.