mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
output time difference in receive of packets from client
This commit is contained in:
parent
83952e7e32
commit
7503db3e19
1 changed files with 6 additions and 4 deletions
|
@ -63,14 +63,10 @@ void *sendBuffer(void *args)
|
|||
timeval startTime, lastSend;
|
||||
|
||||
gettimeofday(&startTime, NULL);
|
||||
gettimeofday(&lastSend, NULL);
|
||||
|
||||
while (true) {
|
||||
sentBytes = 0;
|
||||
|
||||
printf("Last send was %f ms ago\n", (usecTimestampNow() - usecTimestamp(&lastSend)) / 1000);
|
||||
gettimeofday(&lastSend, NULL);
|
||||
|
||||
for (int i = 0; i < agentList.getAgents().size(); i++) {
|
||||
AudioRingBuffer *agentBuffer = (AudioRingBuffer *) agentList.getAgents()[i].getLinkedData();
|
||||
|
||||
|
@ -307,10 +303,16 @@ int main(int argc, const char * argv[])
|
|||
}
|
||||
|
||||
sockaddr *agentAddress = new sockaddr;
|
||||
timeval lastReceive;
|
||||
gettimeofday(&lastReceive, NULL);
|
||||
|
||||
while (true) {
|
||||
if(agentList.getAgentSocket().receive(agentAddress, packetData, &receivedBytes)) {
|
||||
if (packetData[0] == 'I') {
|
||||
|
||||
printf("Last receive was %f ms ago\n", (usecTimestampNow() - usecTimestamp(&lastReceive)) / 1000);
|
||||
gettimeofday(&lastreceive, NULL);
|
||||
|
||||
// add or update the existing interface agent
|
||||
if (!LOOPBACK_SANITY_CHECK) {
|
||||
agentList.addOrUpdateAgent(agentAddress, agentAddress, packetData[0]);
|
||||
|
|
Loading…
Reference in a new issue