def handshake(self):
        """Do the blame handshake with the server.

        connect MUST have been called before this
        """
        if not self.blame_sock:
            raise ValueError("Connection not created before call to handshake")
        headers = self.build_headers()
        f = self.blame_sock.makefile()
        f.write("nogotofail_ctl/1.0\n" +
                "\n".join(("%s: %s" % (key, value) for key, value in headers.iteritems())) +
                "\n\n")
        f.flush()

        line = f.readline().strip()
        if line.split(" ")[0] != "0":
            raise ValueError("Server rejected handshake")
        while True:
            line = f.readline().strip()
            if not line:
                break
            key, value = line.split(":", 1)
            self.resp_headers[key.strip()] = value.strip()
        self.handshake_completed = True
Do the blame handshake with the server.

        connect MUST have been called before this
        
nogotofail/clients/linux/pyblame/blame.py