1 /* Copyright (c) 2006-2021. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
7 package app.bittorrent;
8 import java.util.ArrayList;
10 import org.simgrid.msg.Task;
12 /* Task exchanged between the tracker and the peers. */
13 public class TrackerTask extends Task {
20 protected String hostname;
21 protected String mailbox;
23 protected int uploaded;
24 protected int downloaded;
26 protected double interval;
27 protected ArrayList<Integer> peers;
29 public TrackerTask(String hostname, String mailbox, int peerId) {
30 this(hostname, mailbox, peerId, 0, 0, Common.FILE_SIZE);
33 public TrackerTask(String hostname, String mailbox, int peerId, int uploaded, int downloaded, int left) {
34 super("", 0, Common.TRACKER_COMM_SIZE);
35 this.type = Type.REQUEST;
36 this.hostname = hostname;
37 this.mailbox = mailbox;
39 this.uploaded = uploaded;
40 this.downloaded = downloaded;
42 this.peers = new ArrayList<>();