IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 35310


Ignore:
Timestamp:
Mar 13, 2013, 6:11:52 AM (13 years ago)
Author:
eugene
Message:

fix the problem of connecting to the wrong port owner

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20130307/Ohana/src/libkapa/src/KapaOpen.c

    r35309 r35310  
    44# define MY_PORT_MAX 2520
    55# define MY_WAIT 100000
    6 # define DEBUG 1
     6# define DEBUG 0
    77
    88static int Nvalid = 0;
     
    120120  return (-1);
    121121
    122 accepted:
     122 accepted:
    123123  {
    124124    // we need to do some minimal handshake here.  I will send out
     
    126126    int Nout = write (BindSocket, "KAPA", 4);
    127127    if (Nout != 4) {
    128       fprintf (stderr, "connection failed\n");
     128      if (DEBUG) fprintf (stderr, "connection failed\n");
    129129      close (BindSocket);
    130130      return (-1);
     
    221221  int Nout = read (InitSocket, line, 4);
    222222  if (Nout != 4) {
    223     fprintf (stderr, "connection failed\n");
     223    if (DEBUG) fprintf (stderr, "connection failed\n");
    224224    close (InitSocket);
    225225    return (-1);
    226226  }
    227227  if (strncmp (line, "KAPA", 4)) {
    228     fprintf (stderr, "connection to the wrong survey\n");
     228    if (DEBUG) fprintf (stderr, "connection to the wrong server\n");
    229229    close (InitSocket);
    230230    return (-1);
     
    259259  }
    260260
    261 # if (0)
    262261  int pid = KapaLaunchCommand (line);
    263262  if (!pid) {
     
    265264    return (-1);
    266265  }
    267 # else
    268   int pid = 1;
    269 # endif
    270266
    271267# define NTRY 500
     
    320316
    321317  if (name == NULL) {
    322     sprintf (temp, "%s -socket %s &", kapa_exec, socket_name);
     318    sprintf (temp, "%s -socket %s", kapa_exec, socket_name);
    323319  } else {
    324     sprintf (temp, "%s -socket %s -name %s &", kapa_exec, socket_name, name);
     320    sprintf (temp, "%s -socket %s -name %s", kapa_exec, socket_name, name);
    325321  }
    326322
Note: See TracChangeset for help on using the changeset viewer.