IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 13, 2005, 9:37:58 PM (21 years ago)
Author:
eugene
Message:

pcontrol dev : hosts + jobs running

File:
1 edited

Legend:

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

    r3211 r3212  
    11# include "pcontrol.h"
     2# define PCLIENT_TIMEOUT 20
    23
    3 # define PCLIENT_TIMEOUT 20
    4 # define PCLIENT_PROMPT "pclient:"
    5 
    6 int PclientCommand (Host *host, char *command, IOBuffer *buffer) {
     4int PclientCommand (Host *host, char *command, char *response, IOBuffer *buffer) {
    75
    86  int i;
     
    108  char *line;
    119
     10  ReadtoIOBuffer (buffer, host[0].stdout);
     11  FlushIOBuffer (buffer);
     12
    1213  /* send command to client (adding on \n) */
    13   fprintf (stderr, "send: %s (%d)\n", command, buffer[0].Nbuffer);
     14  /* fprintf (stderr, "send: %s (%d)\n", command, buffer[0].Nbuffer); */
    1415  ALLOCATE (line, char, MAX (1, strlen(command)));
    1516  sprintf (line, "%s\n", command);
     
    2526  for (i = 0; (i < PCLIENT_TIMEOUT) && (status == -1) && (line == NULL); i++) {
    2627    status = ReadtoIOBuffer (buffer, host[0].stdout);
    27     line = memstr (buffer[0].buffer, PCLIENT_PROMPT, buffer[0].Nbuffer);
     28    line = memstr (buffer[0].buffer, response, buffer[0].Nbuffer);
     29    if (status == -1) usleep (10000);
    2830  }
    2931  if (status ==  0) return (PCLIENT_DOWN);
    3032  if (status == -1) return (PCLIENT_HUNG);
    31   fprintf (stderr, "buffer.buffer: %s\n", buffer[0].buffer);
     33  /* fprintf (stderr, "buffer.buffer: %s\n", buffer[0].buffer); */
    3234  return (PCLIENT_GOOD);
    3335}
Note: See TracChangeset for help on using the changeset viewer.