2 * Copyright (c) 2007-2008 Fabrizio Frioli, Michele Pedrolli
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 2 as
6 * published by the Free Software Foundation.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 * Please send your questions/suggestions to:
20 * {fabrizio.frioli, michele.pedrolli} at studenti dot unitn dot it
23 package example.bittorrent;
25 import peersim.core.*;
28 * This class is a {@link SimpleMsg} and represents the <tt>peerset</tt>
29 * message used by the tracker to send to the peers a list of neighbors.
31 public class PeerSetMsg extends SimpleMsg{
34 * The set of "friends" peers sent by the tracker to each node.
36 private Neighbor[] peerSet;
39 * Initializes a new <tt>peerset</tt> message.
40 * @param type is the type of the message (it should be 12)
41 * @param array is the array containing the references to the neighbor nodes
42 * @param sender the sender node
45 public PeerSetMsg(int type, Neighbor []array, Node sender){
47 peerSet = array; // references to the effective nodes
48 super.sender = sender;
53 * @return the peer set, namely the set of neighbor nodes.
55 public Neighbor[] getPeerSet(){