mirror of
https://github.com/Sani7/remote-ui.git
synced 2026-10-26 21:51:13 +01:00
websocket
reducing cpu % from 12% to 3% this by adding this_thread sleep for 1ms and moving sending of data to the process_messages thread
This commit is contained in:
+4
-1
@@ -19,17 +19,20 @@ using websocketpp::lib::placeholders::_2;
|
||||
enum action_type {
|
||||
SUBSCRIBE,
|
||||
UNSUBSCRIBE,
|
||||
MESSAGE
|
||||
MESSAGE,
|
||||
BROADCAST
|
||||
};
|
||||
|
||||
struct action {
|
||||
action(action_type t, websocketpp::connection_hdl h) : type(t), hdl(h) {}
|
||||
action(action_type t, websocketpp::connection_hdl h, Server::message_ptr m)
|
||||
: type(t), hdl(h), msg(m) {}
|
||||
action(action_type t, std::string p) : type(t), payload(p) {}
|
||||
|
||||
action_type type;
|
||||
websocketpp::connection_hdl hdl;
|
||||
Server::message_ptr msg;
|
||||
std::string payload;
|
||||
};
|
||||
|
||||
class Websocket
|
||||
|
||||
Reference in New Issue
Block a user