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/StopHosts.c

    r16472 r17475  
    7272
    7373  int       status;
    74   IOBuffer  buffer;
    7574
    76   InitIOBuffer (&buffer, 0x100);
    77   status = PclientCommand (host, "exit", "Goodbye", &buffer);
    78   FreeIOBuffer (&buffer);
     75  status = PclientCommand (host, "exit", "Goodbye", PCONTROL_RESP_STOP_HOST);
    7976
    8077  /* check on success of pclient command */
    8178  switch (status) {
    8279    case PCLIENT_DOWN:
    83       break;
    84 
    85     case PCLIENT_HUNG:
    86       gprint (GP_ERR, "host %s is not responding\n", host[0].hostname);
     80      // XXX this is the desired result in any case, so ignore it
    8781      break;
    8882
    8983    case PCLIENT_GOOD:
    90       break;
     84      if (VerboseMode()) gprint (GP_ERR, "stop host %s\n", host[0].hostname); 
     85      FlushIOBuffer (&host[0].comms_buffer);
     86      PutHost (host, PCONTROL_HOST_RESP, STACK_BOTTOM);
     87      return (TRUE);
    9188
    9289    default:
    93       gprint (GP_ERR, "unknown status for pclient command: programming error\n"); 
    94       pcontrol_exit (57);
     90      ABORT ("unknown status for pclient command"); 
    9591  }
     92  ABORT ("should not reach here"); 
     93}
     94
     95int StopHostResponse (Host *host) {
     96
    9697  HarvestHost (host[0].pid);
    9798  return (TRUE);
Note: See TracChangeset for help on using the changeset viewer.