Deactivate connection on socket error

This commit is contained in:
Patrick Nicolas
2024-06-03 20:59:06 +02:00
parent 5d9d39eee5
commit 1266a46947
4 changed files with 33 additions and 9 deletions
+5 -1
View File
@@ -192,6 +192,11 @@ clock_offset wivrn_session::get_offset()
return offset_est.get_offset();
}
bool wivrn_session::connected()
{
return connection.is_active();
}
void wivrn_session::operator()(from_headset::headset_info_packet &&)
{
U_LOG_W("unexpected headset info packet, ignoring");
@@ -281,7 +286,6 @@ void wivrn_session::run(std::weak_ptr<wivrn_session> weak_self)
auto self = weak_self.lock();
if (self)
{
self->connection.deactivate();
xrt_session_event event{
.state = {
.type = XRT_SESSION_EVENT_STATE_CHANGE,