eidheim / Simple-WebSocket-Server

A very simple, fast, multithreaded, platform independent WebSocket (WS) and WebSocket Secure (WSS) server and client library implemented using C++11, Boost.Asio and OpenSSL. Created to be an easy way to make WebSocket endpoints in C++.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

It seems that stop() doesn't close the websocket

Skywalker13 opened this issue · comments

Hello,

We have a websocket server where the websocket stays alive even after a call on stop(). The socket is really closed only when the process is terminated.

Any ideas? It should be like eidheim/Simple-Web-Server#86 ?! no ?!

Thanks

Thank you, I also noticed that stop() is not thread safe here: https://github.com/eidheim/Simple-WebSocket-Server/blob/master/server_ws.hpp#L302. Will look into why the socket is kept alive even after stop() is called.

Let me know if the above commit fixes your use case. Thank you again.

Sorry for the late response, I realised I had to read up on this a bit. Especially with respect to the Simple-Web-Server project where the client sockets are not stored anywhere, and still a way is needed to close all the sockets when calling stop(). I'll get around to this soon.