[Twisted-Python] Using IConnector descendant

Dmitry Litovchenko kwaker at uch.net
Mon Feb 17 19:13:37 MST 2003


Currently I have working SOCKS5-client Protocol, Connector and
ClientFactory classes. Almost working.

The question is: when I certainly done and my self.state in protocol
is "done" and transport pipe is ready, how to switch from SOCKS
protocol to underlying one?

Assuming I am inside Protocol object.

    def socks_gotConnectReply (self, data):
        """ Called after server accepts or rejects CONNECT method.
        """
        if data[:2] == "\x05\x00":
            # IMHO no need to analyze other fields of reply, we are done
            #
            self.state = "done"

+++ what to put here to switch from SOCKS to another protocol? +++

            return # do something after we are connected


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






More information about the Twisted-Python mailing list