dfleury2 / beauty

A Simple C++ Http server/client above Boost.Beast
MIT License
186 stars 23 forks source link

add websocket_session::close() to allow for websocket closing. #36

Open dahmadjid opened 2 months ago

dahmadjid commented 2 months ago

Adding something like this to the websocket_session class should do the job i believe.
void close() { _websocket.close(beast::websocket::internal_error); _route.disconnect(_ws_context); }

dfleury2 commented 2 months ago

Hi, is there a way to see the issue happening without the close/disconnect ? The socket is still open somewhere using netstat for example ? Regards,

dahmadjid commented 2 months ago

Hi, No I just wanted to close the websocket myself in case of application-level errors (instead of sending a special message using ->send())