Skip to content

Commit 135b3c6

Browse files
committed
Added documentation for new broadcast methods
1 parent ab9e858 commit 135b3c6

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/main/java/org/java_websocket/server/WebSocketServer.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -812,6 +812,10 @@ public void broadcast(byte[] data) {
812812
broadcast( data, connections );
813813
}
814814

815+
/**
816+
* Send a ByteBuffer to all connected endpoints
817+
* @param data the data to send to the endpoints
818+
*/
815819
public void broadcast(ByteBuffer data) {
816820
broadcast(data, connections);
817821
}
@@ -845,6 +849,11 @@ public void broadcast(byte[] data, Collection<WebSocket> clients) {
845849
}
846850
}
847851

852+
/**
853+
* Send a ByteBuffer to a specific collection of websocket connections
854+
* @param data the data to send to the endpoints
855+
* @param clients a collection of endpoints to whom the text has to be send
856+
*/
848857
public void broadcast(ByteBuffer data, Collection<WebSocket> clients) {
849858
if (data == null || clients == null) {
850859
throw new IllegalArgumentException();

0 commit comments

Comments
 (0)