This commit is contained in:
张青阳 2024-12-02 03:25:03 +00:00 committed by GitHub
commit b71dc01da6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

18
test.h
View File

@ -194,11 +194,19 @@ public:
IUINT32 delay = rttmin;
if (rttmax > rttmin) delay += rand() % (rttmax - rttmin);
pkt->setts(current + delay);
if (peer == 0) {
p12.push_back(pkt);
} else {
p21.push_back(pkt);
}
DelayTunnel *tunnel;
if (peer == 0) {
tunnel = &p12;
}else{
tunnel = &p21;
}
auto iter = tunnel->crbegin();
for(;iter != tunnel->crend(); ++iter){
if((*iter)->ts() <= pkt->ts()){
break;
}
}
tunnel->insert(iter.base(), pkt);
}
// 接收数据