Skip to content

Commit 9196bd9

Browse files
2 parents 3721c99 + d8da811 commit 9196bd9

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

extern/plexa

Submodule plexa updated 1 file

include/gui_server.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ namespace ratio::gui
1515
private:
1616
void on_ws_open(network::websocket_session &ws);
1717
void on_ws_message(network::websocket_session &ws, const std::string &msg);
18+
void on_ws_error(network::websocket_session &ws, const boost::system::error_code &ec);
1819
void on_ws_close(network::websocket_session &ws);
1920

2021
private:

src/gui_server.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace ratio::gui
77
add_file_route("^/$", "client/dist/index.html");
88
add_file_route("^/favicon.ico$", "client/dist");
99
add_file_route("^/assets/.*$", "client/dist");
10-
add_ws_route("^/solver$").on_open(std::bind(&gui_server::on_ws_open, this, std::placeholders::_1)).on_message(std::bind(&gui_server::on_ws_message, this, std::placeholders::_1, std::placeholders::_2)).on_close(std::bind(&gui_server::on_ws_close, this, std::placeholders::_1));
10+
add_ws_route("^/solver$").on_open(std::bind(&gui_server::on_ws_open, this, std::placeholders::_1)).on_message(std::bind(&gui_server::on_ws_message, this, std::placeholders::_1, std::placeholders::_2)).on_error(std::bind(&gui_server::on_ws_error, this, std::placeholders::_1, std::placeholders::_2)).on_close(std::bind(&gui_server::on_ws_close, this, std::placeholders::_1));
1111
}
1212

1313
void gui_server::on_ws_open(network::websocket_session &ws)
@@ -54,11 +54,14 @@ namespace ratio::gui
5454
if (msg == "tick")
5555
exec.tick();
5656
}
57-
void gui_server::on_ws_close(network::websocket_session &ws)
57+
void gui_server::on_ws_error(network::websocket_session &ws, const boost::system::error_code &)
5858
{
5959
std::lock_guard<std::mutex> _(mtx);
6060
sessions.erase(&ws);
6161
}
62+
void gui_server::on_ws_close(network::websocket_session &)
63+
{
64+
}
6265

6366
void gui_server::log(const std::string &msg)
6467
{

0 commit comments

Comments
 (0)