Slow frame rate and make header estimate more conservative. Ignore large RTTs vs. capping
This commit is contained in:
+11
-13
@@ -210,20 +210,18 @@ string Connection::recv( void )
|
|||||||
assert( now >= p.timestamp_reply );
|
assert( now >= p.timestamp_reply );
|
||||||
double R = now - p.timestamp_reply;
|
double R = now - p.timestamp_reply;
|
||||||
|
|
||||||
if ( R > 5000 ) { /* cap large values, e.g. server was Ctrl-Zed */
|
if ( R < 5000 ) { /* ignore large values, e.g. server was Ctrl-Zed */
|
||||||
R = 5000;
|
if ( !RTT_hit ) { /* first measurement */
|
||||||
}
|
SRTT = R;
|
||||||
|
RTTVAR = R / 2;
|
||||||
|
RTT_hit = true;
|
||||||
|
} else {
|
||||||
|
const double alpha = 1.0 / 8.0;
|
||||||
|
const double beta = 1.0 / 4.0;
|
||||||
|
|
||||||
if ( !RTT_hit ) { /* first measurement */
|
RTTVAR = (1 - beta) * RTTVAR + ( beta * fabs( SRTT - R ) );
|
||||||
SRTT = R;
|
SRTT = (1 - alpha) * SRTT + ( alpha * R );
|
||||||
RTTVAR = R / 2;
|
}
|
||||||
RTT_hit = true;
|
|
||||||
} else {
|
|
||||||
const double alpha = 1.0 / 8.0;
|
|
||||||
const double beta = 1.0 / 4.0;
|
|
||||||
|
|
||||||
RTTVAR = (1 - beta) * RTTVAR + ( beta * fabs( SRTT - R ) );
|
|
||||||
SRTT = (1 - alpha) * SRTT + ( alpha * R );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -48,9 +48,9 @@ namespace Network {
|
|||||||
class Transport
|
class Transport
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
static const int SEND_INTERVAL = 20; /* ms between frames */
|
static const int SEND_INTERVAL = 50; /* ms between frames */
|
||||||
static const int ACK_INTERVAL = 1000; /* ms between empty acks */
|
static const int ACK_INTERVAL = 1000; /* ms between empty acks */
|
||||||
static const int HEADER_LEN = 100;
|
static const int HEADER_LEN = 120;
|
||||||
|
|
||||||
/* helper methods for tick() */
|
/* helper methods for tick() */
|
||||||
void update_assumed_receiver_state( void );
|
void update_assumed_receiver_state( void );
|
||||||
|
|||||||
Reference in New Issue
Block a user