IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 35309


Ignore:
Timestamp:
Mar 13, 2013, 5:16:35 AM (13 years ago)
Author:
eugene
Message:

try to handshake in case we got the wrong client on this port

Location:
branches/eam_branches/ipp-20130307/Ohana/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20130307/Ohana/src/libdvo/src/dbExtractAverages.c

    r34844 r35309  
    141141      value.Flt = average[0].ChiSqPar;
    142142      break;
     143
     144    // XXX case AVE_PM_GROUPS:
     145    // XXX   value.Int = GetProperMotionGroups (average, measure);
     146    // XXX   break;
    143147
    144148    case AVE_TMEAN:
     
    278282
    279283
     284// XXX int GetProperMotionGroups (Average *average, Measure *measure) {
     285// XXX   // need the times, excluding ignored detections
     286// XXX   // sort the images
     287// XXX   for (i = 0; i < Ntimes - 1; i++)  {
     288// XXX     if (time[i+1] - time[i] < TRANGE) Ngroup ++;
     289// XXX   }
     290// XXX   return Ngroup;
     291// XXX }
     292// XXX
  • branches/eam_branches/ipp-20130307/Ohana/src/libkapa/src/KapaOpen.c

    r35237 r35309  
    44# define MY_PORT_MAX 2520
    55# define MY_WAIT 100000
    6 # define DEBUG 0
     6# define DEBUG 1
    77
    88static int Nvalid = 0;
     
    121121
    122122accepted:
     123  {
     124    // we need to do some minimal handshake here.  I will send out
     125    // a 4 char message : KAPA
     126    int Nout = write (BindSocket, "KAPA", 4);
     127    if (Nout != 4) {
     128      fprintf (stderr, "connection failed\n");
     129      close (BindSocket);
     130      return (-1);
     131    }
     132  }
     133 
    123134  if (DEBUG) fprintf (stderr, "connection accepted\n");
    124135  return (BindSocket);
     
    205216  }
    206217
     218  // apparently, I can connect on someone else's port (eg GoogleTalkPlugin)
     219  // do a simple handshake before we set !NONBLOCK:
     220  char line[5];
     221  int Nout = read (InitSocket, line, 4);
     222  if (Nout != 4) {
     223    fprintf (stderr, "connection failed\n");
     224    close (InitSocket);
     225    return (-1);
     226  }
     227  if (strncmp (line, "KAPA", 4)) {
     228    fprintf (stderr, "connection to the wrong survey\n");
     229    close (InitSocket);
     230    return (-1);
     231  }
     232
    207233  if (DEBUG) fprintf (stderr, "connected on port: %d\n", Address.sin_port);
    208234  if (DEBUG) fprintf (stderr, "connected\n");
     
    233259  }
    234260
     261# if (0)
    235262  int pid = KapaLaunchCommand (line);
    236263  if (!pid) {
     
    238265    return (-1);
    239266  }
     267# else
     268  int pid = 1;
     269# endif
    240270
    241271# define NTRY 500
  • branches/eam_branches/ipp-20130307/Ohana/src/relastro/src/UpdateObjects.c

    r35288 r35309  
    224224
    225225      if ((mode == FIT_PM_ONLY) || (mode == FIT_PM_AND_PAR)) {
    226         // project all of the R,D coordinates to a plane centered on this coordinate set
     226        // project all of the R,D coordinates to a plane centered on this coordinate. set
    227227        // the times to be relative to Tmean (this is required for parallax as well)
    228228        for (k = 0; k < N; k++) {
     
    270270          catalog[i].average[j].flags |= ID_STAR_FIT_PAR;
    271271          Npar ++;
     272        } else {
     273          // need to set mode = FIT_PM_ONLY if we do not fit for parallax
     274          mode = FIT_PM_ONLY;
    272275        }
    273276      }   
     
    321324                          fit.uD);
    322325
    323       //make sure that the fit succeeded
     326      // make sure that the fit succeeded
    324327      status = TRUE;
    325328      status &= finite(fit.Ro);
Note: See TracChangeset for help on using the changeset viewer.