diff --git a/easywsclient.cpp b/easywsclient.cpp index 5f60642..c7e089b 100644 --- a/easywsclient.cpp +++ b/easywsclient.cpp @@ -148,7 +148,10 @@ struct _RealWebSocket : public WebSocket if (ret > 0) { txbuf.erase(txbuf.begin(), txbuf.begin() + ret); } else { break; } } - if (!txbuf.size() && readyState == CLOSING) { ::close(); } + if (!txbuf.size() && readyState == CLOSING) { + ::close(); + readyState = CLOSED; + } } // Callable must have signature: void(const std::string & message).