本文整理汇总了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)