Get the timing and delayed ACKs right(er)
This commit is contained in:
+6
-2
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user