[Twisted-Python] Another Change to Factory.buildProtocol

Moshe Zadka m at moshez.org
Tue Aug 7 13:51:07 EDT 2001

    def buildProtocol(self, connection):
        """Create an instance of a subclass of Protocol.

        The returned instance will handle input on an incoming server
        connection, and an attribute "factory" pointing to the creating
        factory.  Override this method to alter how Protocol instances get
        p = self.protocol()
        p.factory = self
+       p.connection = connection
        return p

Moshe Zadka - http://moshez.geek
(if you're not cool, http://moshez.org is still working)

More information about the Twisted-Python mailing list