JorgeLópez
jorge.lopez at scati.com
Mon Jun 2 10:50:46 EST 2003
Hello: I labor in a company from Spain and I'm having troubles of memory when I use mod_python. I'm get time of remote computer using 'sockets'. Looking at Task Admin of Windows, I observe that 'Memory Use' augment every time until my computer die. Script tries to connect socket and sends a request of time. Then, socket receives time. Code is: def getTime(host): t = "Error" try: s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((host,8000)) s.send('DAMELAAHORA\0') t = receive(s,15) finally: if s != None: s.close() return t def receive(socket, size): buffer='' while size != 0: data = socket.recv(size) buffer += data size = size-len(data) return buffer I write this 'time' in a file XML. Then, page HTML loads this file with JavaScript every second. I use Window 2000 with Apache 2.0.44, mod_python 3.0.1 and Python 2.2.2. I wait for your answer Thanks
|