X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/000da6bd8e9edf5422d5f7c80763d1c00a964959..6a42d0b4d34e2b9777922430ef85646dabbefa20:/examples/msg/bittorrent/peer.h diff --git a/examples/msg/bittorrent/peer.h b/examples/msg/bittorrent/peer.h index 07491a4fa8..ce96099c7f 100644 --- a/examples/msg/bittorrent/peer.h +++ b/examples/msg/bittorrent/peer.h @@ -1,11 +1,12 @@ -/* Copyright (c) 2012. The SimGrid Team. +/* Copyright (c) 2012-2015. 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. */ + #ifndef BITTORRENT_PEER_H #define BITTORRENT_PEER_H -#include +#include #include #include #include @@ -27,7 +28,7 @@ typedef struct s_peer { xbt_dict_t peers; //peers list xbt_dict_t active_peers; //active peers list - int round; //current round for the chocking algortihm. + int round; //current round for the chocking algorithm. char mailbox[MAILBOX_SIZE]; //peer mailbox. @@ -58,13 +59,9 @@ void peer_free(peer_t peer); int has_finished(char *bitfield); -void handle_pending_sends(peer_t peer); void handle_message(peer_t peer, msg_task_t task); -void wait_for_pieces(peer_t peer, double deadline); - void update_pieces_count_from_bitfield(peer_t peer, char *bitfield); -void update_current_piece(peer_t peer); void update_choked_peers(peer_t peer); void update_interested_after_receive(peer_t peer); @@ -89,9 +86,6 @@ void remove_current_piece(peer_t peer, connection_t remote_peer, void update_active_peers_set(peer_t peer, connection_t remote_peer); int select_piece_to_download(peer_t peer, connection_t remote_peer); - - -void send_interested_to_peers(peer_t peer); void send_handshake_all(peer_t peer); void send_interested(peer_t peer, const char *mailbox);