instrumentation/hrktorrent: print peers' IP addresses
authorP2P-Next <p2p-next@cs.pub.ro>
Thu, 12 Aug 2010 14:57:51 +0000 (17:57 +0300)
committerP2P-Next <p2p-next@cs.pub.ro>
Thu, 12 Aug 2010 14:57:51 +0000 (17:57 +0300)
instrumentation/hrktorrent/core.cpp

index 2295407..e5de712 100644 (file)
@@ -52,7 +52,8 @@ PrintStatusStream(std::stringstream &output, int columns, int stdout_is_tty)
        }\r
 \r
        if (stdout_is_tty) {\r
-               std::cout << s_output.c_str() << "\r";\r
+               /*std::cout << s_output.c_str() << "\r";*/\r
+               std::cout << s_output.c_str() << std::endl;\r
        }\r
        else {\r
                std::cout << s_output.c_str() << std::endl;\r
@@ -145,6 +146,11 @@ CCore::StatusLoop(void* data)
                /* build peer status message */\r
                t->get_peer_info(peers);\r
 \r
+               std::vector<libtorrent::peer_info>::iterator it = peers.begin();\r
+               while (it != peers.end()) {\r
+                       std::cout << it->ip << std::endl;\r
+               }\r
+\r
                sleep(1);\r
                loopcount++;\r
        }\r