'Close the socket underlying this connection.'

def close(self):

    self.rfile.close()
    if (not self.linger):
        if hasattr(self.socket, '_sock'):
            self.socket._sock.close()
        self.socket.close()
    else:
        pass
