X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=test%2Fapp_test%2Freceiver.c;h=6f739a568270acf318001056232c7e1aee69ce8b;hb=refs%2Fheads%2Fbronze;hp=e016f9ee1476ded3621169fd60a45e45234932c8;hpb=412d53dfa2f9b5b56a448797d0dfec3b0f11f666;p=ric-plt%2Flib%2Frmr.git diff --git a/test/app_test/receiver.c b/test/app_test/receiver.c index e016f9e..6f739a5 100644 --- a/test/app_test/receiver.c +++ b/test/app_test/receiver.c @@ -132,9 +132,10 @@ int main( int argc, char** argv ) { fprintf( stderr, " listening on port: %s for a max of %d messages\n", listen_port, nmsgs ); #ifdef MTC + fprintf( stderr, " starting in multi-threaded mode\n" ); mrc = rmr_init( listen_port, RMR_MAX_RCV_BYTES, RMRFL_MTCALL ); // start RMr in mt-receive mode - #else + fprintf( stderr, " starting in direct receive mode\n" ); mrc = rmr_init( listen_port, RMR_MAX_RCV_BYTES, RMRFL_NONE ); // start your engines! #endif if( mrc == NULL ) { @@ -197,6 +198,9 @@ int main( int argc, char** argv ) { while( rt_count > 0 && msg != NULL && msg->state == RMR_ERR_RETRY ) { // to work right in nano we need this :( if( ack_count < 1 ) { // 1st ack, so we need to connect, and we'll wait for that sleep( 1 ); + if( rt_count > 5 ) { + rt_count = 5; // but only for 5sec; not 1000sec! + } } rt_count--; msg = rmr_rts_msg( mrc, msg ); // we don't try to resend if this returns retry @@ -205,6 +209,8 @@ int main( int argc, char** argv ) { ack_count++; } } + + timeout = time( NULL ) + 10; // extend timeout to 10s past last received message } }