def _thread_receiver(self): """ thread to read and handle Messages half-sync-half-async. """ try: from sys import exc_info while 1: try: msg = Message.readfrom(self._io) self._trace("received <- %r" % msg) msg.received(self) except sysex: break except EOFError: break except: self._traceex(exc_info()) break finally: # XXX we need to signal fatal error states to # channels/callbacks, particularly ones # where the other side just died. self._stopexec() try: self._stopsend() except IOError: self._trace('IOError on _stopsend()') self._channelfactory._finished_receiving() self._trace('leaving %r' % threading.currentThread())
def _thread_receiver(self): """ thread to read and handle Messages half-sync-half-async. """ try: from sys import exc_info while 1: try: msg = Message.readfrom(self._io) self._trace("received <- %r" % msg) msg.received(self) except sysex: break except EOFError: break except: self._traceex(exc_info()) break finally: # XXX we need to signal fatal error states to # channels/callbacks, particularly ones # where the other side just died. self._stopexec() try: self._stopsend() except IOError: self._trace('IOError on _stopsend()') self._channelfactory._finished_receiving() if threading: # might be None during shutdown/finalization self._trace('leaving %r' % threading.currentThread())
def _thread_receiver(self): """ thread to read and handle Messages half-sync-half-async. """ try: from sys import exc_info while 1: try: msg = Message.readfrom(self._io) self._trace("received <- %r" % msg) msg.received(self) except sysex: break except EOFError: break except: self._traceex(exc_info()) break finally: self._send(None) self._channelfactory._finished_receiving() self._trace('leaving %r' % threading.currentThread())