P2P File Share
A simple peer-to-peer file sharing system.
|
A thread-safe database of peers. More...
#include <peerdb.hpp>
Public Member Functions | |
bool | addPeer (EndpointID id, const Endpoint &endpoint) |
bool | removePeer (EndpointID id) |
bool | addFile (EndpointID peer_id, const std::string &group_id, const std::string &file_name) |
bool | removeFile (EndpointID peer_id, const std::string &group_id, const std::string &file_name) |
std::vector< std::shared_ptr< Peer > > | getPeers (const std::string &group_id, const std::string &file_name) |
Get a list of peers that have the file. | |
A thread-safe database of peers.
bool PeerDB::addFile | ( | EndpointID | peer_id, |
const std::string & | group_id, | ||
const std::string & | file_name ) |
bool PeerDB::addPeer | ( | EndpointID | id, |
const Endpoint & | endpoint ) |
std::vector< std::shared_ptr< Peer > > PeerDB::getPeers | ( | const std::string & | group_id, |
const std::string & | file_name ) |
Get a list of peers that have the file.
group_id | The group id of the file. |
file_name | The name of the file. |
bool PeerDB::removeFile | ( | EndpointID | peer_id, |
const std::string & | group_id, | ||
const std::string & | file_name ) |
bool PeerDB::removePeer | ( | EndpointID | id | ) |