X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=transports%2Fstratum_tcp.py;h=4bcefabb145e353f41987a09873126276bf642ec;hb=f67ae92c742e2583f61684f15899e973d45dc804;hp=85fc8b75bb892067ab56c5e6fb17c077e62c780c;hpb=eeeb2b0657c395ade790d5f16e673f277b000e11;p=electrum-server.git diff --git a/transports/stratum_tcp.py b/transports/stratum_tcp.py index 85fc8b7..4bcefab 100644 --- a/transports/stratum_tcp.py +++ b/transports/stratum_tcp.py @@ -12,7 +12,7 @@ class TcpSession(Session): Session.__init__(self) self._connection = connection self.address = address[0] - self.name = "TCP session" + self.name = "TCP" def connection(self): if self.stopped(): @@ -55,6 +55,8 @@ class TcpClientRequestor(threading.Thread): if not self.update(): break + self.session.time = time.time() + while self.parse(): pass @@ -123,11 +125,8 @@ class TcpServer(threading.Thread): sock.listen(1) while not self.shared.stopped(): session = TcpSession(*sock.accept()) - client_req = TcpClientRequestor(self.dispatcher, session) - client_req.start() self.dispatcher.add_session(session) self.dispatcher.collect_garbage() - - - + client_req = TcpClientRequestor(self.dispatcher, session) + client_req.start()