Class DummyBroadcaster

java.lang.Object
org.glassfish.grizzly.websockets.DummyBroadcaster
All Implemented Interfaces:
Broadcaster

public class DummyBroadcaster extends Object implements Broadcaster
The default Broadcaster, which iterates over set of clients and sends the same text of binary message separately to each client. So the text/binary -> websocket-frame transformation is being done for each client separately.
Author:
Alexey Stashok
  • Constructor Details

    • DummyBroadcaster

      public DummyBroadcaster()
  • Method Details

    • broadcast

      public void broadcast(Iterable<? extends WebSocket> recipients, String text)
      Broadcasts the provided text content to the specified recipients.
      Specified by:
      broadcast in interface Broadcaster
      Parameters:
      recipients - the recipients of the provided text content.
      text - textual content.
    • broadcast

      public void broadcast(Iterable<? extends WebSocket> recipients, byte[] binary)
      Broadcasts the provided binary content to the specified recipients.
      Specified by:
      broadcast in interface Broadcaster
      Parameters:
      recipients - the recipients of the provided binary content.
      binary - binary content.
    • broadcastFragment

      public void broadcastFragment(Iterable<? extends WebSocket> recipients, String text, boolean last)
      Broadcasts the provided fragmented text content to the specified recipients.
      Specified by:
      broadcastFragment in interface Broadcaster
      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)
      Broadcasts the provided fragmented binary content to the specified recipients.
      Specified by:
      broadcastFragment in interface Broadcaster
      Parameters:
      recipients - the recipients of the provided fragmented binary content.
      binary - fragmented binary content.
      last - true if this is the last fragment, otherwise false.