Changeset 399 in flair-src for trunk/tools/FlairGCS/src/UdtSocket.cpp
- Timestamp:
- Mar 16, 2021, 5:50:25 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/FlairGCS/src/UdtSocket.cpp
r307 r399 15 15 #include <assert.h> 16 16 #include <QThread> 17 17 18 #define COMPRESS_CHUNK 1024*100 18 19 … … 37 38 total_received=0; 38 39 pktSndLossTotal=0; 39 40 lastpktRecvTotal=0; 41 40 42 bool blocking = false; 41 43 if (UDT::setsockopt(socket, 0, UDT_RCVSYN, &blocking, sizeof(bool)) != 0) … … 94 96 fprintf(stderr,"total number of received NAK packets: %i\n",perf.pktRecvNAKTotal); 95 97 fprintf(stderr,"round trip time: %fms\n",perf.msRTT); 96 97 98 }*/ 98 99 bool loosingPackets=false; 99 100 if(perf.pktSndLossTotal>pktSndLossTotal) loosingPackets=true; 100 101 pktSndLossTotal=perf.pktSndLossTotal; 101 stats=QString("rx rate %1kB/s, round trip %2ms, lost packets %3").arg(rxRate,0,'f',3).arg(perf.msRTT,0,'f',3).arg(perf.pktSndLossTotal); 102 UDTStats(stats,loosingPackets); 102 unsigned int pktPerSec=(perf.pktRecvTotal-lastpktRecvTotal)*1000/COMPUTE_UDT_STATS_TIMER; 103 QString stylesheet="color: black"; 104 if(pktPerSec>=100) { 105 stylesheet="color: red"; 106 } 107 else if(pktPerSec>=50) { 108 stylesheet="color: orange"; 109 } 110 stats=QString("rx rate %1kB/s, %2 rx packets/s, round trip %3ms, lost packets %4").arg(rxRate,0,'f',3).arg(pktPerSec).arg(perf.msRTT,0,'f',3).arg(perf.pktSndLossTotal); 111 lastpktRecvTotal=perf.pktRecvTotal; 112 UDTStats(stats,stylesheet,loosingPackets); 103 113 } 104 114
Note:
See TracChangeset
for help on using the changeset viewer.