Commit b75d3586 authored by Antoine Millet's avatar Antoine Millet
Browse files

Releases all running calls when connection is shutdown.

parent 7ed7ceb5
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -331,6 +331,14 @@ class RpcConnection(object):

        self._sock.close()

        # Release all running calls from this connection:
        for call in self._calls.values():
            if 'event' in call:
                call['error'] = {'exception': 'RpcError',
                                 'message': 'Connection reset by peer'}
                call['return'] = None
                call['event'].set()
        
        if callback is not None and not callable(callback):
            if self._handler is not None:
                try: