Skip to content

Commit

Permalink
Documentation for the peer_set structure.
Browse files Browse the repository at this point in the history
git-svn-id: https://subversion.cs.uiuc.edu/svn/bang/eoh2009@12 69d76c3e-0761-0410-948c-9895a8bb34fc
  • Loading branch information
nbysani2 committed Jan 22, 2009
1 parent 3ae30a4 commit a4262cf
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions src/base/bang-com.c
Expand Up @@ -154,12 +154,29 @@ static peer* new_peer(int peer_id, int socket);
*/
static void free_peer(peer *p);

/**
* \param p The peer to stop.
*
* \brief Stops a peer's thread. Note: This
* will most likely make the remote end hang up.
*/
static void peer_stop(peer *p);

/**
* \param p The peer to start.
*
* Starts a peer's threads.
*/
static void peer_start(peer *p);

/**
* \return A new and allocated peer_set.
*/
static peer_set* new_peer_set();

/**
* \brief Frees and dealloctes the peer set.
*/
static void free_peer_set();

/**
Expand All @@ -180,12 +197,38 @@ static int internal_peer_set_get_key(peer_set *ps, int peer_id);
*/
static int peer_set_create_peer(peer_set *ps, int socket);

/**
* \param ps The peer set to remove an peer from.
* \param peer_id The peer to remove from the peer_set.
*
* \brief Removes peer_id from ps if it exisits.
*/
static void peer_set_remove_peer_by_id(peer_set *ps, int peer_id);

/**
* \param ps The peer set with peer peer_id
* \param peer_id A valid peer_id in ps
*
* \brief Calls peer_start on the peer peer_id.
*/
static void peer_set_start_peer_by_id(peer_set *ps, int peer_id);

/**
* \param ps The peer set with peer peer_id
* \param peer_id A valid peer_id in ps
*
* \brief Calls peer_stop on the peer peer_id.
*/
static void peer_set_stop_peer_by_id(peer_set *ps, int peer_id);

/**
* \param ps The peer set with peer peer_id
* \param peer_id A valid peer_id in ps
*
* \return Gets the peer peer_id from ps.
*
* \brief Gets the peer peer_id from ps.
*/
static peer* peer_set_get_peer(peer_set *ps, int peer_id);

/**
Expand Down

0 comments on commit a4262cf

Please sign in to comment.