diff --git a/sjrpc/core/rpcconnection.py b/sjrpc/core/rpcconnection.py index dbc791da638e772fec5baf464e6e1aa2f6ceade7..e8d3d04ec802e3a4e98cf6c5995dd3bc641a554d 100644 --- a/sjrpc/core/rpcconnection.py +++ b/sjrpc/core/rpcconnection.py @@ -396,12 +396,16 @@ class RpcConnection(object): logging.debug('Error while socket close: %s.', err) # Release all running calls from this connection: - for call in self._calls.values(): + for cid, call in self._calls.iteritems(): + err = {'exception': 'RpcError', + 'message': 'Connection reset by peer'} if 'event' in call: - call['error'] = {'exception': 'RpcError', - 'message': 'Connection reset by peer'} + call['error'] = err call['return'] = None call['event'].set() + else: + msg = {'id': cid, 'error': err, 'return': None} + self._manager.signal_arrival(msg) if callback is not None and not callable(callback): if self._handler is not None: