'Disconnect and error-out all requests.'

def close(self):

    with self.lock:
        if self.is_closed:
            return
        self.is_closed = True
    log.debug('Closing    connection    (%s)    to    %s', id(self), self.host)
    self.connector.disconnect()
    log.debug('Closed    socket    to    %s', self.host)
    if (not self.is_defunct):
        self.error_all_requests(ConnectionShutdown(('Connection    to    %s    was    closed' % self.host)))
        self.connected_event.set()
