Use ipc_server_stop to exit during reconnect

This commit is contained in:
Sapphire
2025-12-31 00:59:33 -06:00
parent 21c04be1f8
commit 727d4fab4d
4 changed files with 22 additions and 14 deletions
+3 -5
View File
@@ -19,8 +19,6 @@
#include "accept_connection.h"
#include "server/ipc_server_interface.h"
#include "utils/overloaded.h"
#include "wivrn_config.h"
@@ -29,7 +27,7 @@
#include <sys/poll.h>
std::unique_ptr<wivrn::TCP> wivrn::accept_connection(ipc_server * server, int watch_fd, std::function<bool()> quit)
std::unique_ptr<wivrn::TCP> wivrn::accept_connection(int watch_fd, std::function<bool()> quit)
{
wivrn_ipc_socket_monado->send(from_monado::headset_disconnected{});
@@ -63,8 +61,8 @@ std::unique_ptr<wivrn::TCP> wivrn::accept_connection(ipc_server * server, int wa
auto packet = receive_from_main();
if (packet)
std::visit(utils::overloaded{
[server](to_monado::stop) {
ipc_server_stop(server);
[](to_monado::stop) {
// gets handled in wivrn_session::reconnect since we return nullptr
},
[](auto &&) {
// Ignore request when no headset is connected