Skip to content

Commit

Permalink
try a fix for websocket
Browse files Browse the repository at this point in the history
  • Loading branch information
MammatusPlatypus committed Jun 27, 2016
1 parent 87f78b9 commit 2fb74b8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/

ext {
projectVersion = '1.10.4'
projectVersion = '1.10.5'
boonVersion = '0.6.3'
boonGroup = "io.advantageous.boon"
springFrameworkVersion = '4.2.5.RELEASE'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,19 +170,24 @@ public void close() {
bufferRef[0] = buffer;
});


/* Handle frame. */
vertxServerWebSocket.frameHandler(event -> {
if (event.isFinal()) {
if (event.isBinary()) {
((NetSocketBase) webSocket).setBinary();
webSocket.onBinaryMessage(bufferRef[0].getBytes());
} else {
final String message = bufferRef[0].toString("UTF-8");
webSocket.onTextMessage(message);
}
}
});

vertxServerWebSocket.endHandler(event -> {
if (webSocket.isBinary()) {
webSocket.onBinaryMessage(bufferRef[0].getBytes());
} else {
webSocket.onTextMessage(bufferRef[0].toString("UTF-8"));
}
});


/* Handle error. */
vertxServerWebSocket.exceptionHandler(event -> {
Expand Down

0 comments on commit 2fb74b8

Please sign in to comment.