src/mrt.c
// Accept all incoming connections (returns a possibly empty set/array of connections),
// guaranteed not to block
// - conns: list of connections, must has been initialized
// - res: memset to 0 before use, stores the resulting conn pts
// - size: the size of the conn pt array res, maximum amount of connections probed,
//          not greater than sc->size
// - rc: # of accepted conns
Accept all incoming connections (returns a possibly empty set/array of connections),
guaranteed not to block
conns: list of connections, must has been initialized
res: memset to 0 before use, stores the resulting conn pts
size: the size of the conn pt array res, maximum amount of connections probed,
not greater than sc->size
rc: # of accepted conns
Accept all incoming connections ( returns a possibly empty set / array of connections ) guaranteed not to block conns : list of connections must has been initialized res : memset to 0 before use stores the resulting conn pts size : the size of the conn pt array res maximum amount of connections probed not greater than sc - > size rc : # of accepted conns
int mrt_accept_all(mrt_serv_conn * sc, mrt_connection ** res, int size) {
  int i;
  int rc = 0;
  for (i = 0; i < size; i++) 
    if (sc->conns[i].initialized && !sc->conns[i].active) {
      sc->conns[i].active = 1;
      send_ctrl_pkt(sc->fd, &sc->conns[i].addr, FLAG_SYN | FLAG_ACK, 0, 0);
      res[rc++] = &sc->conns[i];
    }
  return rc;
}
int mrt_accept_all ( mrt_serv_conn * sc , mrt_connection * * res , int size ) { int i ; int rc = 0 ; for ( i = 0 ; i < size ; i ++ ) if ( sc -> conns [ i ] . initialized && ! sc -> conns [ i ] . active ) { sc -> conns [ i ] . active = 1 ; send_ctrl_pkt ( sc -> fd , & sc -> conns [ i ] . addr , FLAG_SYN | FLAG_ACK , 0 , 0 ) ; res [ rc ++ ] = & sc -> conns [ i ] ; } return rc ; }
Accept all incoming connections (returns a possibly empty set/array of connections),
guaranteed not to block
 conns: list of connections, must has been initialized
 res: memset to 0 before use, stores the resulting conn pts
 size: the size of the conn pt array res, maximum amount of connections probed,
not greater than sc->size
 rc: # of accepted conns
Accept all incoming connections ( returns a possibly empty set / array of connections ) guaranteed not to block conns : list of connections must has been initialized res : memset to 0 before use stores the resulting conn pts size : the size of the conn pt array res maximum amount of connections probed not greater than sc - > size rc : # of accepted conns