diff --git a/fstream-server.py b/fstream-server.py index 39f08e6..1d44280 100644 --- a/fstream-server.py +++ b/fstream-server.py @@ -182,11 +182,29 @@ class inThread(threading.Thread): self.closeThread() raise +class debugThread(threading.Thread): + def __init__(self): + threading.Thread.__init__(self) + + def run(self): + while True: + with threadsLock: + print("Threads - IN: " +str(len(inThreads))) + print("Threads - OUT: " +str(len(outThreads))) + time.sleep(10) + def main(): global threadId serverSocket.bind(serverAddr) serverSocket.listen(1024) + # DEBUG + global time + import time + debug = debugThread() + debug.start() + # DEBUG END + while True: connection, address = serverSocket.accept() connection.settimeout(15)