multithreaded

This commit is contained in:
ThomasV 2011-12-23 13:59:20 +03:00
parent 619875a14d
commit 3203dc0934
1 changed files with 3 additions and 1 deletions

View File

@ -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')