[Twisted-Python] [Twisted - Python] Telnet client & keeping connection alive

Itamar Shtull-Trauring itamar at itamarst.org
Wed Aug 10 10:43:13 EDT 2005


On Wed, 2005-08-10 at 15:17 +0200, Michał Tyde wrote:
> First i want to thank all people that responsed for my ealier questions.
> I have done a progress in my project.I am a green in Twisted/Python, and
> network programming in general.
> Now I got a working telnet client. I have got two kind of telnet
> servers. First one (after succesfuly login) keeps connection even if I
> don't send a command to him. Second one disconnect me every 30 sec., if
> I don't send command to him. So I want to create a thread (after
> connection to the server) that will send to him a "pwd" command.

You don't need a thread; twisted lets you schedule events. Look at
reactor.callLater and twisted.internet.task.LoopingCall:

http://twistedmatrix.com/projects/core/documentation/howto/time.html





More information about the Twisted-Python mailing list