コード例 #1
0
ファイル: peer.c プロジェクト: dsedra/Project-3
int main(int argc, char **argv) {
  bt_config_t config;

  bt_init(&config, argc, argv);

  DPRINTF(DEBUG_INIT, "peer.c main beginning\n");


  struct itimerval tout_val;
  
  tout_val.it_interval.tv_sec = 0;
  tout_val.it_interval.tv_usec = 0;
  tout_val.it_value.tv_sec = 0; 
  tout_val.it_value.tv_usec = 100000; // 100 ms
  setitimer(ITIMER_REAL, &tout_val,0);

  signal(SIGALRM,alarmHandler); /* set the Alarm signal capture */
  signal(SIGINT,exitFunc);

#ifdef TESTING
  config.identity = 1; // your group number here
  strcpy(config.chunk_file, "chunkfile");
  strcpy(config.has_chunk_file, "haschunks");
#endif

  bt_parse_command_line(&config);

#ifdef DEBUG
  if (debug & DEBUG_INIT) {
    bt_dump_config(&config);
  }
#endif
  peer_run(&config);
  return 0;
}
コード例 #2
0
ファイル: peer.c プロジェクト: SunnyQ/cmu
int main(int argc, char **argv)
{
    bt_config_t config;
    paramInit(&config, argc, argv);

    DPRINTF(DEBUG_INIT, "peer.c main beginning\n");

#ifdef TESTING
    config.identity = 1; // your group number here
    strcpy(config.chunk_file, "chunkfile");
    strcpy(config.has_chunk_file, "haschunks");
#endif

    bt_parse_command_line(&config);

#ifdef DEBUG
    if (debug & DEBUG_INIT)
    {
        bt_dump_config(&config);
    }
#endif

    peer_run(&config);
    return 0;
}
コード例 #3
0
ファイル: peer.c プロジェクト: Nishant-MC/CS-AD-217-Networks
int main(int argc, char **argv)
{
  bt_config_t config;

  bt_init(&config, argc, argv);

  DPRINTF(DEBUG_INIT, "Starting peer.c ...\n");

  config.identity = 1; 
  strcpy(config.chunk_file, "chunkfile");
  strcpy(config.has_chunk_file, "haschunks");

  bt_parse_command_line(&config);

  bt_dump_config(&config);

  init(&config);
  peer_run(&config);
  return 0;
}