mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 16:41:02 +02:00
ping reporter added to interface take 5
This commit is contained in:
parent
a5dc47eaab
commit
9313dbff52
1 changed files with 1 additions and 4 deletions
|
@ -78,13 +78,10 @@ AgentList::~AgentList() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void AgentList::timePingReply(sockaddr *agentAddress, unsigned char *packetData) {
|
void AgentList::timePingReply(sockaddr *agentAddress, unsigned char *packetData) {
|
||||||
|
|
||||||
char pingPacket[1 + sizeof(long long)];
|
|
||||||
memcpy(pingPacket, packetData, 1 + sizeof(long long));
|
|
||||||
for(AgentList::iterator agent = begin(); agent != end(); agent++) {
|
for(AgentList::iterator agent = begin(); agent != end(); agent++) {
|
||||||
if (socketMatch(agent->getPublicSocket(), agentAddress) ||
|
if (socketMatch(agent->getPublicSocket(), agentAddress) ||
|
||||||
socketMatch(agent->getLocalSocket(), agentAddress)) {
|
socketMatch(agent->getLocalSocket(), agentAddress)) {
|
||||||
int pingTime = usecTimestampNow() - *(long long *)(pingPacket+1);
|
int pingTime = usecTimestampNow() - *(long long *)(packetData + 1);
|
||||||
agent->setPingTime(pingTime / 1000);
|
agent->setPingTime(pingTime / 1000);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue