mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-10 02:32:27 +02:00
Merge pull request #15036 from SimonWalton-HiFi/connect-class-in-nodelist-thread
Connection class should run in NodeList thread
This commit is contained in:
commit
29d5574d93
2 changed files with 4 additions and 2 deletions
|
@ -31,7 +31,6 @@ using namespace udt;
|
|||
using namespace std::chrono;
|
||||
|
||||
Connection::Connection(Socket* parentSocket, HifiSockAddr destination, std::unique_ptr<CongestionControl> congestionControl) :
|
||||
QObject(parentSocket),
|
||||
_parentSocket(parentSocket),
|
||||
_destination(destination),
|
||||
_congestionControl(move(congestionControl))
|
||||
|
|
|
@ -251,7 +251,10 @@ Connection* Socket::findOrCreateConnection(const HifiSockAddr& sockAddr, bool fi
|
|||
auto congestionControl = _ccFactory->create();
|
||||
congestionControl->setMaxBandwidth(_maxBandwidth);
|
||||
auto connection = std::unique_ptr<Connection>(new Connection(this, sockAddr, std::move(congestionControl)));
|
||||
|
||||
if (QThread::currentThread() != thread()) {
|
||||
qCDebug(networking) << "Moving new Connection to NodeList thread";
|
||||
connection->moveToThread(thread());
|
||||
}
|
||||
// allow higher-level classes to find out when connections have completed a handshake
|
||||
QObject::connect(connection.get(), &Connection::receiverHandshakeRequestComplete,
|
||||
this, &Socket::clientHandshakeRequestComplete);
|
||||
|
|
Loading…
Reference in a new issue