mirror of
https://github.com/skywind3000/kcp.git
synced 2025-03-22 07:22:59 +08:00
Merge 6dffd97f64
into 7f9805887b
This commit is contained in:
commit
b71dc01da6
18
test.h
18
test.h
@ -194,11 +194,19 @@ public:
|
|||||||
IUINT32 delay = rttmin;
|
IUINT32 delay = rttmin;
|
||||||
if (rttmax > rttmin) delay += rand() % (rttmax - rttmin);
|
if (rttmax > rttmin) delay += rand() % (rttmax - rttmin);
|
||||||
pkt->setts(current + delay);
|
pkt->setts(current + delay);
|
||||||
if (peer == 0) {
|
DelayTunnel *tunnel;
|
||||||
p12.push_back(pkt);
|
if (peer == 0) {
|
||||||
} else {
|
tunnel = &p12;
|
||||||
p21.push_back(pkt);
|
}else{
|
||||||
}
|
tunnel = &p21;
|
||||||
|
}
|
||||||
|
auto iter = tunnel->crbegin();
|
||||||
|
for(;iter != tunnel->crend(); ++iter){
|
||||||
|
if((*iter)->ts() <= pkt->ts()){
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
tunnel->insert(iter.base(), pkt);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 接收数据
|
// 接收数据
|
||||||
|
Loading…
Reference in New Issue
Block a user