Remove synthetic packet loss
This commit is contained in:
+2
-2
@@ -161,9 +161,11 @@ void Connection::send( string &s, bool send_timestamp )
|
|||||||
string p = px.tostring( &session );
|
string p = px.tostring( &session );
|
||||||
|
|
||||||
/* XXX synthetic packet loss */
|
/* XXX synthetic packet loss */
|
||||||
|
/*
|
||||||
if ( rand() < RAND_MAX / 2 ) {
|
if ( rand() < RAND_MAX / 2 ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
ssize_t bytes_sent = sendto( sock, p.data(), p.size(), 0,
|
ssize_t bytes_sent = sendto( sock, p.data(), p.size(), 0,
|
||||||
(sockaddr *)&remote_addr, sizeof( remote_addr ) );
|
(sockaddr *)&remote_addr, sizeof( remote_addr ) );
|
||||||
@@ -210,8 +212,6 @@ string Connection::recv( void )
|
|||||||
assert( now >= p.timestamp_reply );
|
assert( now >= p.timestamp_reply );
|
||||||
const double R = now - p.timestamp_reply;
|
const double R = now - p.timestamp_reply;
|
||||||
|
|
||||||
fprintf( stderr, "Saw delay of %f\r\n", R );
|
|
||||||
|
|
||||||
if ( !RTT_hit ) { /* first measurement */
|
if ( !RTT_hit ) { /* first measurement */
|
||||||
SRTT = R;
|
SRTT = R;
|
||||||
RTTVAR = R / 2;
|
RTTVAR = R / 2;
|
||||||
|
|||||||
Reference in New Issue
Block a user