if __name__ == '__main__':
    server = ThreadedTCPServer(serverAddr, SomeCode)
server_thread = threading.Thread(target=server.serve_forever)
server_thread.start()
try:
    signal.pause()
except:
    server.shutdown()
SocketServer ThreadingMixIn purpose of server_thread