Use ipc_server_stop to exit during reconnect
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user