Skip to content

Commit

Permalink
* list_peer_notes example added
Browse files Browse the repository at this point in the history
git-svn-id: file:///home/toad/git-migration/temprepository/trunk/apps/CppFCPLib@14297 67a373e5-eb02-0410-a15c-ee090a768436
  • Loading branch information
mkolar committed Jul 24, 2007
1 parent 911db64 commit 3a7b5e1
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions Node.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class Node {
void shutdown() {
log().log(DEBUG, "about to shutdown the node");
executor.interrupt();
log().log(DEBUG, "node is shutdown");
}

bool isAlive() const {
Expand Down
25 changes: 25 additions & 0 deletions examples/list_peer_notes.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#include <iostream>
#include "FCPLib.h"

using namespace FCPLib;

int main( int argc, char* argv[]) {
if ( argc != 2 ) {
std::cout << "Usage :: ./list_peer_notes <identity>" << std::endl;
return 1;
}

Node n("List Peer Notes Test", "", -1);

MessagePtrContainer peer_notes = n.listPeerNotes(argv[1]);

for (MessagePtrContainer::iterator it = peer_notes.begin();
it != peer_notes.end();
++it) {
std::cout << (*it)->toString() << std::endl;
std::cout << std::endl;
}
n.shutdown();

return 0;
}

0 comments on commit 3a7b5e1

Please sign in to comment.