Skip to content

Commit

Permalink
[grid] keep the code and reason for closing the websocket
Browse files Browse the repository at this point in the history
  • Loading branch information
joerg1985 committed Oct 25, 2023
1 parent 5d44d12 commit 43170d2
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -45,7 +45,9 @@ public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise)
Message seMessage = (Message) msg;

if (seMessage instanceof CloseMessage) {
ctx.writeAndFlush(new CloseWebSocketFrame(true, 0));
CloseMessage closeMessage = (CloseMessage) seMessage;
ctx.writeAndFlush(
new CloseWebSocketFrame(true, 0, closeMessage.code(), closeMessage.reason()));
} else if (seMessage instanceof BinaryMessage) {
ctx.writeAndFlush(
new BinaryWebSocketFrame(
Expand Down

0 comments on commit 43170d2

Please sign in to comment.