from whrandom import randrange
import threading
import thread
+ import sys
port = 2001
l = []
time.sleep(1)
for peer in l[1:]:
peer.app.run()
- time.sleep(10)
+ time.sleep(3)
print "adding contacts...."
- for peer in l[1:]:
+ for peer in l:
n = l[randrange(0, len(l))].node
peer.addContact(host, n.port)
n = l[randrange(0, len(l))].node
peer.addContact(host, n.port)
n = l[randrange(0, len(l))].node
peer.addContact(host, n.port)
- if pause:
- time.sleep(.33)
+ if pause:
+ time.sleep(.33)
+ sys.stdout.flush()
time.sleep(10)
print "finding close nodes...."
f.set()
peer.findCloseNodes(cb)
flag.wait()
-
+ sys.stdout.flush()
# for peer in l:
# peer.refreshTable()
return l