IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 3, 2005, 5:50:08 PM (21 years ago)
Author:
eugene
Message:

psched / pscontrol / pclient dev work

File:
1 edited

Legend:

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

    r4689 r4705  
    11# include "pcontrol.h"
     2# define RETRY_BASE 1.0
    23
    34int StartHost (Host *host) {
     
    67  int stdio[3];
    78  char command[64], shell[64];
    8 
    9   /* pid = rconnect (CONNECT, host[0].hostname, PCLIENT, stdio); */
     9  struct timeval now;
     10  float delta;
    1011
    1112  /* perhaps change the name of these config variables... */
     
    1415
    1516  pid = rconnect (command, host[0].hostname, shell, stdio);
    16   if (!pid) {     /** failure to start **/
     17  if (!pid) {     
     18    /** failure to start: extend retry period **/
    1719    if (VerboseMode()) fprintf (stderr, "failure to start %s\n", host[0].hostname);
     20    gettimeofday (&now, (void *) NULL);
     21    if (ZTIME(host[0].nexttry) || ZTIME(host[0].lasttry)) {
     22      /* reset retry period if either is zero */
     23      delta = RETRY_BASE;
     24    } else {
     25      delta = 2*DTIME (host[0].nexttry, host[0].lasttry);
     26    }
     27    host[0].nexttry.tv_sec  = now.tv_sec  + delta;
     28    host[0].nexttry.tv_usec = now.tv_usec;
     29    host[0].lasttry.tv_sec  = now.tv_sec;
     30    host[0].lasttry.tv_usec = now.tv_usec;
    1831    PutHost (host, PCONTROL_HOST_DOWN, STACK_BOTTOM);
    1932    return (FALSE);
    2033  }
     34  host[0].nexttry.tv_sec  = 0;
     35  host[0].nexttry.tv_usec = 0;
     36  host[0].lasttry.tv_sec  = 0;
     37  host[0].lasttry.tv_usec = 0;
     38
    2139  host[0].stdin  = stdio[0];
    2240  host[0].stdout = stdio[1];
Note: See TracChangeset for help on using the changeset viewer.