X-Git-Url: https://git.novaco.in/?p=electrum-server.git;a=blobdiff_plain;f=backends%2Firc%2F__init__.py;h=571aedb24d1f58e5dd7ba97d91b3c4b003f3dbe0;hp=9c9a61f93a05d88207cdf46b958dd72ef28a5d5b;hb=3da0c07024ca0a6158cb1d5688b266348b876161;hpb=ead428133a5b419021153d8cbb27603053ea4cf4 diff --git a/backends/irc/__init__.py b/backends/irc/__init__.py index 9c9a61f..571aedb 100644 --- a/backends/irc/__init__.py +++ b/backends/irc/__init__.py @@ -72,6 +72,7 @@ class IrcThread(threading.Thread): def run(self): ircname = self.getname() + print_log("joining IRC") while not self.processor.shared.stopped(): try: @@ -80,6 +81,7 @@ class IrcThread(threading.Thread): s.settimeout(0.1) except: s.close() + print_log("IRC: reconnect in 10 s") time.sleep(10) continue @@ -99,13 +101,12 @@ class IrcThread(threading.Thread): if out_msg: m = out_msg.pop(0) s.send(m) - continue + continue except: print_log( "irc: socket error" ) time.sleep(1) break - self.message += data while self.message.find('\n') != -1: @@ -115,6 +116,7 @@ class IrcThread(threading.Thread): line = line.strip('\r') if not line: continue + # print_log("<--", line) line = line.split() if line[0] == 'PING': out_msg.append('PONG ' + line[1] + '\n') @@ -201,6 +203,10 @@ class ServerProcessor(Processor): elif method == 'server.version': result = VERSION + elif method == 'server.getpid': + import os + result = os.getpid() + elif method == 'server.stop': self.shared.stop() result = 'stopping, please wait until all threads terminate.'