Get the timing and delayed ACKs right(er)

This commit is contained in:
Keith Winstein
2011-08-19 04:46:12 -04:00
parent fdfd7b010b
commit 772d476022
9 changed files with 153 additions and 58 deletions
+6 -2
View File
@@ -45,11 +45,13 @@ int main( int argc, char *argv[] )
uint64_t last_num = n->get_remote_state_num();
while ( true ) {
try {
if ( poll( &my_pollfd, 1, n->tick() ) < 0 ) {
if ( poll( &my_pollfd, 1, n->wait_time() ) < 0 ) {
perror( "poll" );
exit( 1 );
}
n->tick();
if ( my_pollfd.revents & POLLIN ) {
n->recv();
@@ -89,10 +91,12 @@ int main( int argc, char *argv[] )
while( true ) {
try {
if ( poll( fds, 2, n->tick() ) < 0 ) {
if ( poll( fds, 2, n->wait_time() ) < 0 ) {
perror( "poll" );
}
n->tick();
if ( fds[ 0 ].revents & POLLIN ) {
char x;
assert( read( STDIN_FILENO, &x, 1 ) == 1 );