Package org.glassfish.grizzly.websockets
Class OptimizedBroadcaster
java.lang.Object
org.glassfish.grizzly.websockets.OptimizedBroadcaster
- All Implemented Interfaces:
Broadcaster
The default
Broadcaster optimized to send the same text to a set of
clients.
NOTE: works with DefaultWebSockets and inherited classes.- Author:
- Alexey Stashok
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidBroadcasts the provided binary content to the specified recipients.voidBroadcasts the provided text content to the specified recipients.voidbroadcastFragment(Iterable<? extends WebSocket> recipients, byte[] binary, boolean last) Broadcasts the provided fragmented binary content to the specified recipients.voidbroadcastFragment(Iterable<? extends WebSocket> recipients, String text, boolean last) Broadcasts the provided fragmented text content to the specified recipients.
-
Constructor Details
-
OptimizedBroadcaster
public OptimizedBroadcaster()
-
-
Method Details
-
broadcast
Broadcasts the provided text content to the specified recipients.- Specified by:
broadcastin interfaceBroadcaster- Parameters:
recipients- the recipients of the provided text content.text- textual content.
-
broadcast
Broadcasts the provided binary content to the specified recipients.- Specified by:
broadcastin interfaceBroadcaster- Parameters:
recipients- the recipients of the provided binary content.binary- binary content.
-
broadcastFragment
Description copied from interface:BroadcasterBroadcasts the provided fragmented text content to the specified recipients.- Specified by:
broadcastFragmentin interfaceBroadcaster- Parameters:
recipients- the recipients of the provided fragmented text content.text- fragmented textual content.last- true if this is the last fragment, otherwise false.
-
broadcastFragment
public void broadcastFragment(Iterable<? extends WebSocket> recipients, byte[] binary, boolean last) Description copied from interface:BroadcasterBroadcasts the provided fragmented binary content to the specified recipients.- Specified by:
broadcastFragmentin interfaceBroadcaster- Parameters:
recipients- the recipients of the provided fragmented binary content.binary- fragmented binary content.last- true if this is the last fragment, otherwise false.
-