# PeersManager Class Reference

Class used by the tracker to manage a set of peers and all related attributes. More...

`#include <PeersManager.h>`

List of all members.

## Public Member Functions

int | add_peer (PeerInfo *peer)
| Function used to add a peer.
int | get_peer_port (std::string peer_id)
| Function that returns a given peer port.
std::string | get_peer_ip_adr (std::string peer_id)
| Function that returns a given peer ip @.
string | get_peer_bencoded_info (string peer_id, string info_hash)
| Function that returns a given peer bencoded status.
string | get_limited_peer_bencoded_info (string peer_id, string info_hash)
| Function that returns a given peer restricted bencoded status.
PeerInfo * | get_peer_info (std::string peer_id, string peer_ip)
| Function that returns a PeerInfo object given its id and ip @.
int | get_number_of_known_peers ()
| Function that returns the number of managed peers.
string | get_peers_list ()
| Function that returns the peers list as a bencoded message.
bool | eliminate_confusion (string peer_id, string torrent_id, string ip, char *to_delete)
| Function used to eliminate confusion while adding a new peer.
void | update_peer (string p_id, string ip, int port, int nw)
| Method used to update a given peer status.
bool | is_it_a_seeder (string peer_id, string info_hash)
| Function that returns if a given peer is a seeder or not.
int | get_number_of_peers ()
| Function that returns the number of peers.
bool | CheckOutOfDate (string &sPeerId)
| Check if the peer is out of date in order to delete it.

## Private Attributes

std::map< string, PeerInfo * > | peers_map
| Map used to store the status object of each peer.

## Detailed Description

Class used by the tracker to manage a set of peers and all related attributes.

The documentation for this class was generated from the following files:

- Mes documents/Visual Studio 2005/Projects/WM-ADHOC-TRACKER/WM-ADHOC-TRACKER/PeersManager.h
- Mes documents/Visual Studio 2005/Projects/WM-ADHOC-TRACKER/WM-ADHOC-TRACKER/PeersManager.cpp