File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,11 @@ namespace SL {
6060 if (socket->SocketStatus_ == SocketStatus::CONNECTED) {
6161 // only send messages if the socket is in a connected state
6262 write (parent, socket, msg.msg );
63+ // update the socket status to reflect it is closing to prevent other messages from being sent.. this is the last valid message
64+ // make sure to do this after a call to write so the write process sends the close message, but no others
65+ if (msg.code == OpCode::CLOSE) {
66+ socket->SocketStatus_ = SocketStatus::CLOSING;
67+ }
6368 }
6469 }
6570 else {
@@ -77,11 +82,6 @@ namespace SL {
7782 if (socket->SendMessageQueue .size () == 1 ) {
7883 SL::WS_LITE::startwrite (parent, socket);
7984 }
80- // update the socket status to reflect it is closing to prevent other messages from being sent.. this is the last valid message
81- // make sure to do this after a call to startwrite so the write process sends the close message, but no others
82- if (msg.code == OpCode::CLOSE) {
83- socket->SocketStatus_ = SocketStatus::CLOSING;
84- }
8585 }
8686 });
8787 }
You can’t perform that action at this time.
0 commit comments