From b1b8fc9f25fcff8bc145889abfaefe4ea48bf629 Mon Sep 17 00:00:00 2001 From: Samo Penic <samo.penic@gmail.com> Date: Tue, 15 May 2018 17:42:19 +0000 Subject: [PATCH] Merge branch 'master' of ssh://git.penic.eu:29418/trisurf-client --- playground/tsclient.py | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/playground/tsclient.py b/playground/tsclient.py index 83e3938..4b0724c 100755 --- a/playground/tsclient.py +++ b/playground/tsclient.py @@ -17,8 +17,8 @@ def get_ip(): return ((([ip for ip in socket.gethostbyname_ex(socket.gethostname())[2] if not ip.startswith("127.")] or [[(s.connect(("8.8.8.8", 53)), s.getsockname()[0], s.close()) for s in [socket.socket(socket.AF_INET, socket.SOCK_DGRAM)]][0][1]]) + ["no IP found"])[0]) -def get_client_id(addr, my_ip, my_hostname): - client_auth={'ip':my_ip,'hostname':my_hostname} +def get_client_id(addr, my_ip, my_hostname, subrun): + client_auth={'ip':my_ip,'hostname':my_hostname, 'subrun':subrun} response=requests.post(addr+"/api/register/", data=client_auth) if(response.status_code==200): client_data=json.loads(response.text) @@ -138,7 +138,7 @@ def run(self): while(not self.isStopped()): try: - cid=get_client_id(self.conn_address, self.ip, self.hostname) + cid=get_client_id(self.conn_address, self.ip, self.hostname, self.id) except: print("[{}] Could not get CID.".format(self.id)) self.sleep(10) @@ -314,6 +314,7 @@ t=ClientThread(update_seconds=100) t.start() - print("main") + #t.join() + #print("main") while(True): sleep(1000) -- Gitblit v1.9.3