Commit 12d8b798 authored by Antoine Millet's avatar Antoine Millet
Browse files

Fixed repeated calls to shutdown method on a RpcConnection

parent 0567093e
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -415,6 +415,12 @@ class RpcConnection(object):
        '''
        Shutdown this connection.
        '''
        # Ignore repeated calls to shutdown:
        if not self._connected:
            return
        # Unset connected state:
        self._connected = False

        self.logger.info('Connection shutdown.')
        # Shutdown each registered watcher:
        for watcher in self._watchers:
@@ -425,7 +431,6 @@ class RpcConnection(object):
            proto.shutdown()

        # Close the connection socket:
        self._connected = False
        try:
            self._sock.shutdown(socket.SHUT_RDWR)
            self._sock.close()