예제 #1
0
import ServerProxy

nb_iter = 1000
server = "iconnect.iro.umontreal.ca"
port = 80
sleep_time = 0

print sys.argv
if len(sys.argv) > 1:
    server = sys.argv[1]
if len(sys.argv) > 2:
    port = int(sys.argv[2])
if len(sys.argv) > 3:
    sleep_time = float(sys.argv[3])
print "server", server, "port", port, "sleep_time", sleep_time
sp = ServerProxy(server, port)

if False:
    # Need to change permissions on ServerProxy Java class for this to work.
    print 'Calling doJsonRequest directly...'
    r = sp.doJsonRequest('/get_pings', None)
    print r

print

info = ClientInfo("", "yoda")

pings_queue = [None] * nb_iter
t0 = time.time()
for i in range(nb_iter):
    if sleep_time > 0: