mirror of
https://github.com/overte-org/overte.git
synced 2025-04-07 10:32:25 +02:00
update packet sending in IceServer
This commit is contained in:
parent
426f631178
commit
1797c21890
1 changed files with 3 additions and 8 deletions
|
@ -127,18 +127,13 @@ SharedNetworkPeer IceServer::addOrUpdateHeartbeatingPeer(const QByteArray& incom
|
|||
}
|
||||
|
||||
void IceServer::sendPeerInformationPacket(const NetworkPeer& peer, const HifiSockAddr* destinationSockAddr) {
|
||||
QByteArray outgoingPacket(MAX_PACKET_SIZE, 0);
|
||||
int currentPacketSize = populatePacketHeaderWithUUID(outgoingPacket, PacketTypeIceServerPeerInformation, _id);
|
||||
int numHeaderBytes = currentPacketSize;
|
||||
auto peerPacket { NLPacket::create(PacketType::IceServerPeerInformation); }
|
||||
|
||||
// get the byte array for this peer
|
||||
QByteArray peerBytes = peer.toByteArray();
|
||||
outgoingPacket.replace(numHeaderBytes, peerBytes.size(), peerBytes);
|
||||
|
||||
currentPacketSize += peerBytes.size();
|
||||
peerPacket->write(peer.toByteArray());
|
||||
|
||||
// write the current packet
|
||||
_serverSocket.writeDatagram(outgoingPacket.data(), outgoingPacket.size(),
|
||||
_serverSocket.writeDatagram(peerPacket.constData(), peerPacket.sizeUsed(),
|
||||
destinationSockAddr->getAddress(), destinationSockAddr->getPort());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue