本文整理汇总了Python中Client.Client.stop_zmq_req方法的典型用法代码示例。如果您正苦于以下问题:Python Client.stop_zmq_req方法的具体用法?Python Client.stop_zmq_req怎么用?Python Client.stop_zmq_req使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Client.Client
的用法示例。
在下文中一共展示了Client.stop_zmq_req方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: str
# 需要导入模块: from Client import Client [as 别名]
# 或者: from Client.Client import stop_zmq_req [as 别名]
#the request
conn = httplib.HTTPConnection(ip + ":" + httpport)
params = urllib.urlencode({'port': port, 'repsize': repsize, 'delay' : delay, 'size' : size})
headers = {"Content-type": "application/x-www-form-urlencoded",
"Accept": "text/plain"}
try:
conn.request("POST", "http://" + ip + ":" + httpport + "/" + str(args.type), params, headers)
response = conn.getresponse()
print Fore.GREEN + "Server is ONLINE" + Fore.RESET
except:
sys.exit(Fore.RED + "Couldn't reach a Server on " + ip + ":" + httpport + Fore.RESET)
if args.run == 'stop':
client = Client(Progressbar(flow))
client.stop_zmq_req(ip, port)
sys.exit()
if args.run == 'status':
server_status()
if args.run == 'run':
#This is a functionmap that calls a function by type
functionMap = {"zmq_req": init_zmq_req, "zmq_pub": init_zmq_pub, "ws" : init_ws}
functionToCall = functionMap[type]
functionToCall()
if type is not None and args.run is None:
try:
print "abort with Ctrl-C"
time.sleep(2)