Skip to content

Commit 365f72f

Browse files
committed
fix heartbeat
1 parent ed4c8c0 commit 365f72f

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

ui/windows/collabroom.cpp

+11-11
Original file line numberDiff line numberDiff line change
@@ -174,17 +174,6 @@ CollabRoom::CollabRoom(bool isServer, QString roomId, QWidget *parent) :
174174
qDebug() << "set spout" << s;
175175
});
176176

177-
// If server, start sending heartbeat, and rtt update
178-
if (isServer) {
179-
heartbeat = std::unique_ptr<QThread>(QThread::create([this]() {
180-
while (!exiting) {
181-
QThread::sleep(10);
182-
heartbeatUpdate();
183-
}
184-
}));
185-
heartbeat->start();
186-
}
187-
188177
usageStat = std::make_unique<QTimer>(this);
189178
connect(usageStat.get(), &QTimer::timeout, this, [this]() {
190179
usageStatUpdate();
@@ -408,6 +397,17 @@ void CollabRoom::roomInfoSucceed(const vts::server::RspRoomInfo &info) {
408397
serverPeer->startClient();
409398
}
410399

400+
// If server, start sending heartbeat, and rtt update
401+
if (isServer) {
402+
heartbeat = std::unique_ptr<QThread>(QThread::create([this]() {
403+
while (!exiting) {
404+
QThread::sleep(10);
405+
heartbeatUpdate();
406+
}
407+
}));
408+
heartbeat->start();
409+
}
410+
411411
show();
412412
activateWindow();
413413
}

0 commit comments

Comments
 (0)