|
|
|
|
@ -74,6 +74,7 @@ class JsonRpc(object):
|
|
|
|
|
|
|
|
|
|
body = json.dumps(obj) |
|
|
|
|
|
|
|
|
|
while True: |
|
|
|
|
try: |
|
|
|
|
self.conn.request("POST", "", body, headers) |
|
|
|
|
response = self.conn.getresponse() |
|
|
|
|
@ -97,8 +98,13 @@ class JsonRpc(object):
|
|
|
|
|
except httplib.BadStatusLine: |
|
|
|
|
return "CONNFAILURE" |
|
|
|
|
except Exception as exc: |
|
|
|
|
if str(exc) == "Connection reset by peer": |
|
|
|
|
self.conn.connect() |
|
|
|
|
continue |
|
|
|
|
else: |
|
|
|
|
raise JsonRpcConnectionError("JSON-RPC connection failed. Err:" + |
|
|
|
|
repr(exc)) |
|
|
|
|
break |
|
|
|
|
|
|
|
|
|
def call(self, method, params): |
|
|
|
|
""" |
|
|
|
|
|