IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 23, 2008, 11:35:39 AM (18 years ago)
Author:
eugene
Message:

split out client command from client response; allow response to return slowly

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/pcontrol/CheckSystem.c

    r16589 r17475  
    9999
    100100    if (RunLevel != PCONTROL_RUN_NONE) {
     101      Nhostchecks += CheckRespHosts(0.020); /* check for incoming messages */
     102      TestCheckPoint ();
    101103      Nhostchecks += CheckDoneHosts(0.020); /* reset the host */
    102104      TestCheckPoint ();
     
    258260}
    259261
     262int CheckRespHosts (float MaxDelay) {
     263
     264  struct timeval start, stop;
     265  int i, Nobject;
     266  Stack *stack;
     267  Host  *host;
     268  float dtime;
     269
     270  /* Loop through objects on the stack, no more than once. see note above */
     271  stack = GetHostStack (PCONTROL_HOST_RESP);
     272  Nobject = stack[0].Nobject;
     273
     274  /* always allow at least one test */
     275  gettimeofday (&start, (void *) NULL);
     276  dtime = 0.0;
     277  for (i = 0; (i < Nobject) && (dtime < MaxDelay); i++) {
     278    host = PullStackByLocation (stack, STACK_TOP);
     279    if (host == NULL) break;
     280    CheckRespHost (host);
     281    gettimeofday (&stop, (void *) NULL);
     282    dtime = DTIME (stop, start);
     283  }
     284  if (DEBUG) gprint (GP_ERR, "checked %d hosts\n", i);
     285  return (i);
     286}
     287
    260288int CheckDoneHosts (float MaxDelay) {
    261289
Note: See TracChangeset for help on using the changeset viewer.