netrpc: names at client threads
authorP. Christeas <p_christ@hol.gr>
Mon, 26 Jul 2010 09:33:36 +0000 (12:33 +0300)
committerP. Christeas <p_christ@hol.gr>
Mon, 26 Jul 2010 09:33:36 +0000 (12:33 +0300)
Have a name for client threads, too.

bzr revid: p_christ@hol.gr-20100726093336-8me0gn4gvexuzk5r

bin/service/netrpc_server.py

index fcd6657..80cb968 100644 (file)
@@ -36,7 +36,9 @@ import tools
 
 class TinySocketClientThread(threading.Thread, netsvc.OpenERPDispatcher):
     def __init__(self, sock, threads):
-        threading.Thread.__init__(self)
+        spn = sock and sock.getpeername()
+        spn = 'netrpc-client-%s:%s' % spn[0:2]
+        threading.Thread.__init__(self, name=spn)
         self.sock = sock
         # Only at the server side, use a big timeout: close the
         # clients connection when they're idle for 20min.