IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 14, 2005, 10:33:53 AM (21 years ago)
Author:
eugene
Message:

cleanup up communications for speed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/pclient/ChildOps.c

    r4762 r4763  
    11# include "pclient.h"
     2#include <sys/ioctl.h>
     3#include <sys/types.h>
     4#include <unistd.h>
     5#include <stropts.h>
    26
    37static int Nbad = 0;
     
    2933  struct timeval now;
    3034
    31   /* this is really lame : check if we are calling too quickly
    32      this is unneeded: pclient.c rl_keyboard_input_timeout limits
    33      the rate
    34   gettimeofday (&now, NULL);
    35   dtime = DTIME (now, last);
     35  /* runaway test - if pcontrol is killed, pclient starts running away.  this test is a bit
     36     dangerous: the choice of dtime probably depends on the processor and the value provided to
     37     pclient.c:rl_set_keyboard_input_timeout (1000); note that we cannot use getppid == 1 as a test
     38     because the parent of pclient is the ssh process on the pclient host, not pcontrol.  in any
     39     case, the opihi shell catches if the ssh dies using getppid
     40   */
     41  gettimeofday (&now, (void *) NULL);
     42  dtime = 1e6*DTIME (now, last);
     43  if (dtime < 100) {
     44    Nbad ++;
     45    if (Nbad > 10) {
     46      fprintf (stderr, "runaway!\n");
     47      exit (2);
     48    }
     49  }
     50  if (dtime > 950) Nbad = 0;
    3651  last = now;
    37   if (dtime < 0.0001) Nbad ++;
    38   if (dtime > 0.01) Nbad = 0;
    39   if (Nbad > 10) exit (2);
    40   */
    41 
    42   /* this is a bit lame : we must exit if calling process exits */
    43   ppid = getppid();
    44   if (ppid == 1) exit (2);
    4552
    4653  CheckChildStatus ();
Note: See TracChangeset for help on using the changeset viewer.