Commit 5e1a68f6 authored by Anaël Beutot's avatar Anaël Beutot Committed by Antoine Millet
Browse files

Fix closing early connections

Error message was: "RpcError: Not connected to the peer"
parent 943d6973
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -29,7 +29,8 @@ import threading

from sjrpc.core.protocols import Protocol, RpcProtocol, TunnelProtocol
from sjrpc.core.exceptions import (RpcConnectionError, NoFreeLabelError,
                                   FallbackModeEnabledError, SocketError)
                                   FallbackModeEnabledError, SocketError,
                                   RpcError)

import pyev

@@ -440,7 +441,11 @@ class RpcConnection(object):

        # Shutdown each registered protocols:
        for proto in self._protocols.values():
            try:
                proto.shutdown()
            except RpcError:
                # FIXME use errno on RpcError
                pass

        # Close the connection socket:
        try: