standalone seeder
authorvictor <victor@e16421f0-f15b-0410-abcd-98678b794739>
Tue, 3 Nov 2009 11:00:36 +0000 (11:00 +0000)
committervictor <victor@e16421f0-f15b-0410-abcd-98678b794739>
Tue, 3 Nov 2009 11:00:36 +0000 (11:00 +0000)
git-svn-id: https://ttuki.vtt.fi/svn/p2p-next/TUD/p2tp/trunk@495 e16421f0-f15b-0410-abcd-98678b794739

exec/seeder.cpp [new file with mode: 0644]

diff --git a/exec/seeder.cpp b/exec/seeder.cpp
new file mode 100644 (file)
index 0000000..3d957ed
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ *  connecttest.cpp
+ *  serp++
+ *
+ *  Created by Victor Grishchenko on 3/19/09.
+ *  Copyright 2009 Delft University of Technology. All rights reserved.
+ *
+ */
+#include "p2tp.h"
+
+
+using namespace p2tp;
+
+
+int main (int argn, char** args) {
+    
+    assert(0<p2tp::Listen(7001));
+       
+       int file = p2tp::Open("doc/sofi.jpg");
+    
+    while (true) {
+           p2tp::Loop(TINT_SEC);
+        printf("%lli dgram %lli bytes up, %lli dgram %lli bytes down\n",
+            Datagram::dgrams_up, Datagram::bytes_up,
+            Datagram::dgrams_down, Datagram::bytes_down );
+    }
+    
+       p2tp::Close(file);
+
+       p2tp::Shutdown();
+
+}
+