Added a broadcast method for ByteBuffers #712
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Added two new methods to WebSocketServer:
broadcast(ByteBuffer)
andbroadcast(ByteBuffer, Collection<WebSocket>
).Since was duplicated code, I forwarded the
broadcast(byte[])
methods to the ByteBuffer version by usingByteBuffer.wrap
Related Issue
#711
Motivation and Context
It allows broadcasting data from a ByteBuffer.
How Has This Been Tested?
All tests are passing.
I haven't added any extra tests, mostly because I have no idea where to put them (where are the old broadcast methods tested?). Whoever reviews this, please answer that.
Types of changes
Checklist: