Exemple #1
0
/******************************************************************
*
* send common functions (public)
*
*******************************************************************/
void msend(mfile *m)
{
  if(!m){
    return;
  }
  if(m->mdata.head.flags & MAKUO_FLAG_ACK){
    msend_ack(moption.mcsocket, m); 
  }else{
    if(!msend_retry(m)){
      msend_req(moption.mcsocket, m); 
      mtimeget(&m->lastsend);
    }
  }
}
Exemple #2
0
void do_exechk(mcomm *c){
  int    i;
  mfile *m;
  for(i=0;i<MAX_COMM;i++){
    if(c[i].working){
      if(c[i].isalive){
        if(mtimeout(&(c[i].tv), (uint32_t)1000)){
          cprintf(0, &(c[i]), "alive\n");
          mtimeget(&(c[i].tv));
        }
      }
      if((c[i].cpid == 0) && (c[i].fd[1] == -1)){
        for(m=mftop[MFSEND];m;m=m->next){
          if(m->comm == &c[i]){
            break; /* working */
          }
        }
        if(!m){
          workend(&c[i]);
        }
      }
    }
  }
}