Closed kyuupichan closed 8 years ago
try to remove the try..except block in get_daemon, after you have launched the first wallet
Is this helpful?
Traceback (most recent call last):
File "./electrum", line 327, in
it looks like the jsonrpc lib is not working properly on your system. I guess that all daemon commands are broken for you as well
can you test if that works for you: https://docs.python.org/2/library/simplexmlrpcserver.html#simplexmlrpcserver-example
Yes it seems to work fine. Server output after many invocations:
neil@zotac:~$ python2.7 /tmp/server.py 127.0.0.1 - - [05/Dec/2015 20:12:04] "POST /RPC2 HTTP/1.1" 200 - 127.0.0.1 - - [05/Dec/2015 20:12:04] "POST /RPC2 HTTP/1.1" 200 - 127.0.0.1 - - [05/Dec/2015 20:12:04] "POST /RPC2 HTTP/1.1" 200 - 127.0.0.1 - - [05/Dec/2015 20:12:04] "POST /RPC2 HTTP/1.1" 200 - 127.0.0.1 - - [05/Dec/2015 20:12:19] "POST /RPC2 HTTP/1.1" 200 - 127.0.0.1 - - [05/Dec/2015 20:12:19] "POST /RPC2 HTTP/1.1" 200 - 127.0.0.1 - - [05/Dec/2015 20:12:19] "POST /RPC2 HTTP/1.1" 200 - 127.0.0.1 - - [05/Dec/2015 20:12:19] "POST /RPC2 HTTP/1.1" 200 - 127.0.0.1 - - [05/Dec/2015 20:12:20] "POST /RPC2 HTTP/1.1" 200 -
Client output from 2 invocations:
neil@zotac:~$ python2.7 /tmp/client.py 8 5 2 ['add', 'div', 'pow', 'system.listMethods', 'system.methodHelp', 'system.methodSignature'] neil@zotac:~$ neil@zotac:~$ python2.7 /tmp/client.py 8 5 2 ['add', 'div', 'pow', 'system.listMethods', 'system.methodHelp', 'system.methodSignature']
This is the problematic line:
self.server.socket.settimeout(1)
Without that line it works. Why do we need to set a timeout?
Since interface.py sets socket timeouts without issue, albeit whilst directly controlling the sockets itself, I can only think this is something about the way the JSON server works, or a difference between our Python versions.
Fixed with 03b4868bf84340ba0d5c847e3eec07b227f123d6. ThomasV confirmed working for him too.
It seems recent daemon changes have an issue. When opening the 2nd wallet I get:
Traceback (most recent call last): File "./electrum", line 355, in
daemon = Daemon(config, network, gui)
File "/home/neil/src/electrum/lib/daemon.py", line 72, in init
self.server = SimpleJSONRPCServer((host, port), requestHandler=RequestHandler, logRequests=False)
File "/usr/local/lib/python2.7/site-packages/jsonrpclib/SimpleJSONRPCServer.py", line 211, in init
bind_and_activate)
File "/usr/local/lib/python2.7/SocketServer.py", line 420, in init
self.server_bind()
File "/usr/local/lib/python2.7/SocketServer.py", line 434, in server_bind
self.socket.bind(self.server_address)
File "/usr/local/lib/python2.7/socket.py", line 228, in meth
return getattr(self._sock,name)(*args)
socket.error: [Errno 48] Address already in use