[Twisted-Python] Using IConnector

Dmitry Litovchenko kwaker at uch.net
Tue Feb 18 14:45:44 EST 2003


I certainly need a brief sample of how to use reactor.connectWith and
how to set up Protocol so that it correctly switches to another
Protocol and initializes it.

Example with:

    self.__class__ = anotherProto.__class__
    self.connectionMade()

is good but not enough. Constructor must be called at least and
parameters should be passed to it.

If I solve this problem in my way this may be incompatible with the
whole Twisted ideology, which I currently don't know well. But I need
to know the right way because I intend to create SOCKS 4, 5 and HTTP
tunnel modules not for my use only but to contribute to Twisted.

Please advise, I don't want to produce working code that works for me
only while violating ten tons of Twisted conventions that are
undocumented and invisible for me.

-- 
Best regards,
 Dmitry                          mailto:kwaker at uch.net






More information about the Twisted-Python mailing list