After receiving the data, generate the deferreds and add myself to it.

def dataReceived(self, data):
        """
        After receiving the data, generate the deferreds and add myself to it.
        """
        def write(result):
            print "Writing %r" % result
            self.transport.write(result)
        d = self.d()
        d.addCallback(write)  # errors are silently ignored!
        d.callback(data)