Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
bittorrent: Replace the last isend by dsend
[simgrid.git] / examples / msg / bittorrent / peer.h
index b468774..31f21fc 100644 (file)
@@ -24,11 +24,11 @@ typedef struct s_peer {
   short *pieces_count;          //number of peers that have each piece.
 
   xbt_dynar_t current_pieces;   //current pieces the peer is downloading
-  int current_piece;            //current pieces
-  int pieces_requested;         //number of pieces the peer has requested
 
   xbt_dict_t peers;             //peers list
   xbt_dict_t active_peers;      //active peers list
+  int round;                    //current round for the chocking algortihm.
+
 
   char mailbox[MAILBOX_SIZE];   //peer mailbox.
   char mailbox_tracker[MAILBOX_SIZE];   //pair mailbox while communicating with the tracker.
@@ -37,13 +37,11 @@ typedef struct s_peer {
   msg_task_t task_received;     //current task being received
   msg_comm_t comm_received;     //current comm
 
-  int round;                    //current round for the chocking algortihm.
 
   RngStream stream;             //RngStream for
 
   double begin_receive_time;    //time when the receiving communication has begun, useful for calculating host speed.
 
-  xbt_dynar_t pending_sends;    // list of sends being delivered
 } s_peer_t, *peer_t;
 
 /**
@@ -91,8 +89,8 @@ void send_choked(peer_t peer, const char *mailbox);
 void send_unchoked(peer_t peer, const char *mailbox);
 void send_have(peer_t peer, int piece);
 
-void send_request(peer_t peer, const char *mailbox, int piece, int block_index,
-                  int block_length);
+void send_request(peer_t peer, const char *mailbox, int piece,
+                  int block_index, int block_length);
 void send_piece(peer_t peer, const char *mailbox, int piece, int stalled,
                 int block_index, int block_length);