Re: [Twisted-Python] What is wrong with this instance?

First I wanted to say is that i attached a file with _working_ code. Please try to change a user nad password in telnet_User, and telnet_Password. try to execute function from TelnetProtocol class (function telnet_KeepAlive). It doesn't execute, and becouse of that is after # sign. With this line commented program works just fine (executes every 5 sec. a telnet_KeepAlive2() ),but it does nothing important. Run this program with this line commented, You should see that he prints (after connection): keeping alive 1 keeping alive 2 keeping alive 1 keeping alive 2 ... but I must to execute telnet_KeepAlive() method (from TelnetProtocol, _and this is the problem_). This method should send by self.write("pwd\n \r") command to telnet server. Sorry if I repeat myself, but I try to explain the problem the best way I could. If I uncoment line in telnet_KeepAlive2 (line: tel.telnet_KeepAlive()),my telnet client connect to server and now do nothing (doesn't get into telnet_KeepAlive2 loop).
I know that my problem has something common with instance of class TelnetProtocol. How to could I pass on a TelnetProtocol method or instance to interior of telnet_KeepAlive function? Or maybe there is another solution. Thank You in advance for answers.
participants (1)
-
Michał Tyde