本文整理匯總了Python中Server.stop方法的典型用法代碼示例。如果您正苦於以下問題:Python Server.stop方法的具體用法?Python Server.stop怎麽用?Python Server.stop使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Server
的用法示例。
在下文中一共展示了Server.stop方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: enumerate
# 需要導入模塊: import Server [as 別名]
# 或者: from Server import stop [as 別名]
srvlist = srvmap.items()
for idx, key in enumerate(climap):
if idx >= numPairs: continue
cli = Client(key, climap[key])
cli.setTarget(srvlist[idx][1], "5201")
cli.setType("udp")
# cli.setUdpOptions("495m")
cli.setUdpOptions("495m","1400")
clients.append(cli)
print key,climap[key] + " sends to " + srvlist[idx][0],srvlist[idx][1]
for cli in clients:
thread = threading.Thread(target=partial(cli.run, 10))
threads.append(thread)
time.sleep(10)
# before = timer()
for thread in threads:
thread.start()
for thread in threads:
thread.join()
# after = timer()
for srv in servers:
srv.stop()
# print "%.3f seconds between starting iperf sessions and when all of them are done (some overhead expected)" % (after - before)