mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 00:13:10 +02:00
Add PacketReceiver to LimitedNodeList
This commit is contained in:
parent
5940aee0e7
commit
9d0bffaa19
2 changed files with 7 additions and 0 deletions
|
@ -48,6 +48,7 @@ LimitedNodeList::LimitedNodeList(unsigned short socketListenPort, unsigned short
|
|||
_localSockAddr(),
|
||||
_publicSockAddr(),
|
||||
_stunSockAddr(STUN_SERVER_HOSTNAME, STUN_SERVER_PORT),
|
||||
_packetReceiver(this),
|
||||
_numCollectedPackets(0),
|
||||
_numCollectedBytes(0),
|
||||
_packetStatTimer(),
|
||||
|
@ -92,6 +93,8 @@ LimitedNodeList::LimitedNodeList(unsigned short socketListenPort, unsigned short
|
|||
// check the local socket right now
|
||||
updateLocalSockAddr();
|
||||
|
||||
connect(_nodeSocket, &QUdpSocket::readyRead, _packetReceiver, &PacketReceiver::processDatagrams);
|
||||
|
||||
_packetStatTimer.start();
|
||||
}
|
||||
|
||||
|
|
|
@ -121,6 +121,8 @@ public:
|
|||
|
||||
bool packetVersionAndHashMatch(const QByteArray& packet);
|
||||
|
||||
PacketReceiver& getPacketReceiver() { return _packetReceiver; }
|
||||
|
||||
// QByteArray byteArrayWithPopulatedHeader(PacketType::Value packetType)
|
||||
// { return byteArrayWithUUIDPopulatedHeader(packetType, _sessionUUID); }
|
||||
// int populatePacketHeader(QByteArray& packet, PacketType::Value packetType)
|
||||
|
@ -305,6 +307,8 @@ protected:
|
|||
HifiSockAddr _publicSockAddr;
|
||||
HifiSockAddr _stunSockAddr;
|
||||
|
||||
PacketReceiver _packetReceiver;
|
||||
|
||||
// XXX can BandwidthRecorder be used for this?
|
||||
int _numCollectedPackets;
|
||||
int _numCollectedBytes;
|
||||
|
|
Loading…
Reference in a new issue