This repository was archived by the owner on Jun 12, 2018. It is now read-only.

Description
It would be great to have an example on how to send data from the server to a client in an asynchronous way.
I mean by that that the server should send data every couple of seconds to a connected client.
I could not figure out how this could be accomplished with the existing examples.
I think of calling something like that:
while (true) {
auto send_stream = std::make_shared<WsServer::SendStream>();
*send_stream << "mystring: " << asdfasf++;
(*(ws_server->get_connections().begin()))->send(send_stream);
sleep(2);
}
after that
ws_server_thread = std::thread([&]() {
ws_server->start();
ws_server_started = true;
});
Thanks in advance.