From: Georg Brandl Date: Wed, 3 Oct 2012 20:53:57 +0000 (+0200) Subject: Make server initialization respect DRY a bit more. X-Git-Tag: 1.6~4^2~5 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4958b0b45935b619cb6348b7446ccd8ab9c190db;p=irker.git Make server initialization respect DRY a bit more. --- diff --git a/irkerd b/irkerd index 21b8d73..80dae80 100755 --- a/irkerd +++ b/irkerd @@ -463,13 +463,11 @@ if __name__ == '__main__': sys.exit(0) irker = Irker(debuglevel=debuglvl) tcpserver = SocketServer.TCPServer((HOST, PORT), IrkerTCPHandler) - tcpserver = threading.Thread(target=tcpserver.serve_forever) - tcpserver.setDaemon(True) - tcpserver.start() udpserver = SocketServer.UDPServer((HOST, PORT), IrkerUDPHandler) - udpserver = threading.Thread(target=udpserver.serve_forever) - udpserver.setDaemon(True) - udpserver.start() + for server in [tcpserver, udpserver]: + server = threading.Thread(target=server.serve_forever) + server.setDaemon(True) + server.start() try: while True: time.sleep(10)