From 385db085c7e8c52b8bef13bc33fa164d7ae8827e Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Mon, 24 Feb 2003 16:05:00 +0000 Subject: [PATCH] added receive watchdog delay test --- src/ca/acctst.c | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/src/ca/acctst.c b/src/ca/acctst.c index 64c06eb4d..74377d528 100644 --- a/src/ca/acctst.c +++ b/src/ca/acctst.c @@ -2219,6 +2219,8 @@ void verifyReasonableBeaconPeriod ( chid chan, unsigned interestLevel ) { if ( ca_get_ioc_connection_count () > 0 ) { double beaconPeriod; + double watchDogDelay; + unsigned i; showProgressBegin ( "verifyReasonableBeaconPeriod", interestLevel ); @@ -2229,9 +2231,33 @@ void verifyReasonableBeaconPeriod ( chid chan, unsigned interestLevel ) beaconPeriod = ca_beacon_period ( chan ); assert ( beaconPeriod >= 0.0 ); - printf ( "Estimated beacon period for channel %s = %f sec.\n", + printf ( "Estimated beacon period for channel %s = %g sec.\n", ca_name ( chan ), beaconPeriod ); + watchDogDelay = ca_receive_watchdog_delay ( chan ); + assert ( watchDogDelay >= 0.0 ); + + printf ( "busy: receive watchdog for \"%s\" expires in %g sec.\n", + ca_name ( chan ), watchDogDelay ); + + /* + * let one default connection timeout go by w/o receive activity + * so we can see if beacons reset the watchdog + */ + for ( i = 0u; i < 15u; i++ ) { + showProgress ( interestLevel ); + ca_pend_event ( 2.0 ); + } + if ( interestLevel > 0 ) { + printf ( "\n" ); + } + + watchDogDelay = ca_receive_watchdog_delay ( chan ); + assert ( watchDogDelay >= 0.0 ); + + printf ( "inactive: receive watchdog for \"%s\" expires in %g sec.\n", + ca_name ( chan ), watchDogDelay ); + showProgressEnd ( interestLevel ); } }