X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/8e8f8b64b899284cbd166542ba352cd0c44059e8..aed6c0fceb5d7963006a105350770507030878ba:/examples/msg/bittorrent/bittorrent.c diff --git a/examples/msg/bittorrent/bittorrent.c b/examples/msg/bittorrent/bittorrent.c deleted file mode 100644 index d6fd85d69c..0000000000 --- a/examples/msg/bittorrent/bittorrent.c +++ /dev/null @@ -1,57 +0,0 @@ -/* Copyright (c) 2012. The SimGrid Team. - * All rights reserved. */ - -/* This program is free software; you can redistribute it and/or modify it - * under the terms of the license (GNU LGPL) which comes with this package. */ -#include "bittorrent.h" -#include "peer.h" -#include "tracker.h" -#include -#include - -/** - * Bittorrent example launcher - */ -int main(int argc, char *argv[]) -{ - xbt_dynar_t host_list; - msg_host_t host; - unsigned i; - - MSG_init(&argc, argv); - - /* Check the arguments */ - if (argc < 3) { - printf("Usage: %s platform_file deployment_file \n", argv[0]); - return -1; - } - - const char *platform_file = argv[1]; - const char *deployment_file = argv[2]; - - MSG_create_environment(platform_file); - - host_list = MSG_hosts_as_dynar(); - xbt_dynar_foreach(host_list, i, host) { - char descr[512]; - RngStream stream; - snprintf(descr, sizeof descr, "RngSream<%s>", MSG_host_get_name(host)); - stream = RngStream_CreateStream(descr); - MSG_host_set_data(host, stream); - } - - MSG_function_register("tracker", tracker); - MSG_function_register("peer", peer); - - MSG_launch_application(deployment_file); - - MSG_main(); - - xbt_dynar_foreach(host_list, i, host) { - RngStream stream = MSG_host_get_data(host); - RngStream_DeleteStream(&stream); - } - xbt_dynar_free(&host_list); - - return 0; -}