'Closes all currently opened connections.
This operation is not thread safe and is only a best effort strategy
to close active connections.
All connections are guaranteed to be closed only if no other thread
is accessing the client and no call is pending.'

def close(self):

    size = len(self.deque)
    for _ in range(0, size):
        try:
            connection = self.deque.pop()
            quiet_close(connection)
        except IndexError:
            pass
