src/mrt.c
// mrt_close: indicate incoming connections are no-longer accepted
indicate incoming connections are no-longer accepted
indicate incoming connections are no - longer accepted
int mrt_close(mrt_serv_conn * sc) {
  int i;
  if (MRT_TEST) printf("Server closing...\n");
  for (i = 0; i < sc->size; i++) 
    if (sc->conns[i].active) 
      send_ctrl_pkt(sc->fd, &sc->conns[i].addr, FLAG_FIN, 0, 0);
  close(sc->fd);
  kill(sc->pid, SIGKILL);
  msync(sc->conns, sizeof(mrt_serv_conn), MS_SYNC);
  munmap(sc->conns, sizeof(mrt_serv_conn));
  free(sc);
  return 0;
}
int mrt_close ( mrt_serv_conn * sc ) { int i ; if ( MRT_TEST ) printf ( " \n " ) ; for ( i = 0 ; i < sc -> size ; i ++ ) if ( sc -> conns [ i ] . active ) send_ctrl_pkt ( sc -> fd , & sc -> conns [ i ] . addr , FLAG_FIN , 0 , 0 ) ; close ( sc -> fd ) ; kill ( sc -> pid , SIGKILL ) ; msync ( sc -> conns , sizeof ( mrt_serv_conn ) , MS_SYNC ) ; munmap ( sc -> conns , sizeof ( mrt_serv_conn ) ) ; free ( sc ) ; return 0 ; }
mrt_close: indicate incoming connections are no-longer accepted
mrt_close : indicate incoming connections are no - longer accepted
// send FIN to all active connections