mirror of
https://github.com/overte-org/overte.git
synced 2025-04-14 15:47:02 +02:00
only have the ice-server respond if there was a matching conectee
This commit is contained in:
parent
5203113b41
commit
aa15ef7f85
1 changed files with 7 additions and 4 deletions
|
@ -102,7 +102,7 @@ void IceServer::processDatagrams() {
|
||||||
if (requestingConnections.size() > 0) {
|
if (requestingConnections.size() > 0) {
|
||||||
// send a heartbeart response based on the set of connections
|
// send a heartbeart response based on the set of connections
|
||||||
qDebug() << "Sending a heartbeat response to" << senderUUID << "who has" << requestingConnections.size()
|
qDebug() << "Sending a heartbeat response to" << senderUUID << "who has" << requestingConnections.size()
|
||||||
<< "potential connections";
|
<< "potential connections";
|
||||||
sendHeartbeatResponse(sendingSockAddr, requestingConnections);
|
sendHeartbeatResponse(sendingSockAddr, requestingConnections);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -114,6 +114,7 @@ void IceServer::sendHeartbeatResponse(const HifiSockAddr& destinationSockAddr, Q
|
||||||
|
|
||||||
QByteArray outgoingPacket(MAX_PACKET_SIZE, 0);
|
QByteArray outgoingPacket(MAX_PACKET_SIZE, 0);
|
||||||
int currentPacketSize = populatePacketHeader(outgoingPacket, PacketTypeIceServerHeartbeatResponse, _id);
|
int currentPacketSize = populatePacketHeader(outgoingPacket, PacketTypeIceServerHeartbeatResponse, _id);
|
||||||
|
int numHeaderBytes = currentPacketSize;
|
||||||
|
|
||||||
// go through the connections, sending packets containing connection information for those nodes
|
// go through the connections, sending packets containing connection information for those nodes
|
||||||
while (peerID != connections.end()) {
|
while (peerID != connections.end()) {
|
||||||
|
@ -142,9 +143,11 @@ void IceServer::sendHeartbeatResponse(const HifiSockAddr& destinationSockAddr, Q
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// write the last packet
|
if (currentPacketSize > numHeaderBytes) {
|
||||||
_serverSocket.writeDatagram(outgoingPacket.data(), currentPacketSize,
|
// write the last packet, if there is data in it
|
||||||
destinationSockAddr.getAddress(), destinationSockAddr.getPort());
|
_serverSocket.writeDatagram(outgoingPacket.data(), currentPacketSize,
|
||||||
|
destinationSockAddr.getAddress(), destinationSockAddr.getPort());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void IceServer::clearInactivePeers() {
|
void IceServer::clearInactivePeers() {
|
||||||
|
|
Loading…
Reference in a new issue