Skip to content

Commit

Permalink
Server connections must echo back CLOSE message
Browse files Browse the repository at this point in the history
  • Loading branch information
mikee47 committed Mar 31, 2024
1 parent 46e8ff9 commit 031ce6d
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,8 @@ void WebsocketConnection::close()
if(isClientConnection) {
uint16_t status = htons(1000);
send(reinterpret_cast<char*>(&status), sizeof(status), WS_FRAME_CLOSE);
} else if(controlFrame.type == WS_FRAME_CLOSE) {
send(controlFrame.payload, controlFrame.payloadLength, WS_FRAME_CLOSE);
}
activated = false;
if(wsDisconnect) {
Expand Down

0 comments on commit 031ce6d

Please # to comment.