David 10 лет назад
Родитель
Сommit
ec6ac2a7a0
1 измененных файлов с 7 добавлено и 3 удалено
  1. 7 3
      wsread.py

+ 7 - 3
wsread.py

@@ -34,7 +34,7 @@ def close():
 	ws.close()
 
 def sighandler(signal,frame):
-	print("Exiting!")
+	print("\rExiting!")
 	close()
 	print("Bye!")
 	sys.exit(0)
@@ -43,7 +43,11 @@ def stop(key):
 	if key not in p_list:
 		print("key %s doesn't exist! not killing!" % (key))
 		return
-	os.killpg(os.getpgid(p_list[key].pid), signal.SIGTERM)
+	try:
+		os.killpg(os.getpgid(p_list[key].pid), signal.SIGTERM)
+	except Exception as e:
+		print("This process (%d) can't be killed! Why?" % p_list[key].pid)
+		print(e)
 
 	try:
 		log_list[key].close()
@@ -82,7 +86,7 @@ def sendmsg(msg):
 	except Exception as e:
 		print(e)
 		return None
-	print(ret)
+	print("[nc output] %s " % ret)
 	return ret
 
 ip="ws://192.168.1.208:9001"