Skip to content

Commit

Permalink
echo WS_OPCODE_CLOSE
Browse files Browse the repository at this point in the history
  • Loading branch information
ithewei committed Nov 17, 2023
1 parent bb2fae9 commit 4f03f37
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions http/client/WebSocketClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ int WebSocketClient::open(const char* _url, const http_headers& headers) {
channel->opcode = (enum ws_opcode)opcode;
switch (opcode) {
case WS_OPCODE_CLOSE:
channel->send(msg, WS_OPCODE_CLOSE);
channel->close();
break;
case WS_OPCODE_PING:
Expand Down
1 change: 1 addition & 0 deletions http/server/HttpHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ bool HttpHandler::SwitchWebSocket() {
ws_channel->opcode = (enum ws_opcode)opcode;
switch(opcode) {
case WS_OPCODE_CLOSE:
ws_channel->send(msg, WS_OPCODE_CLOSE);
ws_channel->close();
break;
case WS_OPCODE_PING:
Expand Down

0 comments on commit 4f03f37

Please sign in to comment.