Skip to content

Commit

Permalink
fix heartbeat
Browse files Browse the repository at this point in the history
  • Loading branch information
reitowo committed Jun 2, 2024
1 parent ed4c8c0 commit 365f72f
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions ui/windows/collabroom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,17 +174,6 @@ CollabRoom::CollabRoom(bool isServer, QString roomId, QWidget *parent) :
qDebug() << "set spout" << s;
});

// If server, start sending heartbeat, and rtt update
if (isServer) {
heartbeat = std::unique_ptr<QThread>(QThread::create([this]() {
while (!exiting) {
QThread::sleep(10);
heartbeatUpdate();
}
}));
heartbeat->start();
}

usageStat = std::make_unique<QTimer>(this);
connect(usageStat.get(), &QTimer::timeout, this, [this]() {
usageStatUpdate();
Expand Down Expand Up @@ -408,6 +397,17 @@ void CollabRoom::roomInfoSucceed(const vts::server::RspRoomInfo &info) {
serverPeer->startClient();
}

// If server, start sending heartbeat, and rtt update
if (isServer) {
heartbeat = std::unique_ptr<QThread>(QThread::create([this]() {
while (!exiting) {
QThread::sleep(10);
heartbeatUpdate();
}
}));
heartbeat->start();
}

show();
activateWindow();
}
Expand Down

0 comments on commit 365f72f

Please sign in to comment.