summaryrefslogtreecommitdiffhomepage
path: root/whiteboard.h
diff options
context:
space:
mode:
Diffstat (limited to 'whiteboard.h')
-rw-r--r--whiteboard.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/whiteboard.h b/whiteboard.h
index d645115..e39b94e 100644
--- a/whiteboard.h
+++ b/whiteboard.h
@@ -8,6 +8,7 @@
#include <boost/asio/ip/tcp.hpp>
#include "config.h"
+#include "connectionregistry.h"
#include "storage.h"
class Whiteboard
@@ -20,8 +21,13 @@ private:
std::unique_ptr<Config> m_config;
std::unique_ptr<Storage> m_storage;
std::mutex m_storage_mutex;
+ std::mutex m_websocket_mutex;
+
+ ConnectionRegistry m_registry;
- std::string handle_request(const std::string& request);
+ using connection = std::shared_ptr<boost::beast::websocket::stream<boost::asio::ip::tcp::socket>>;
+ std::string handle_request(connection& c, const std::string& request);
+ void notify_other_connections(connection& c, const std::string& id); // notify all other id-related connections about changes
void do_session(boost::asio::ip::tcp::socket socket);
void storage_cleanup();
};