commit 3203dc093464b5e3f3bc210203f17301e0e162a7
parent 619875a14d3d25c07995f48b47d6a078a9843f7e
Author: ThomasV <thomasv@gitorious>
Date: Fri, 23 Dec 2011 13:59:20 +0300
multithreaded
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/server/server.py b/server/server.py
@@ -654,8 +654,10 @@ def irc_thread():
def jsonrpc_thread(store):
# see http://code.google.com/p/jsonrpclib/
+ from SocketServer import ThreadingMixIn
from jsonrpclib.SimpleJSONRPCServer import SimpleJSONRPCServer
- server = SimpleJSONRPCServer(('localhost', 8080))
+ class SimpleThreadedJSONRPCServer(ThreadingMixIn, SimpleJSONRPCServer): pass
+ server = SimpleThreadedJSONRPCServer(('localhost', 8080))
server.register_function(lambda : peer_list.values(), 'peers')
server.register_function(cmd_stop, 'stop')
server.register_function(cmd_load, 'load')