[Twisted-Python] How to stop reactor when execution finishes on more than one ssh server?
jtdeng at gmail.com
Sat Sep 29 13:08:52 EDT 2007
in the sample sshsimpleclient.py, it demostrated how to connect to a ssh
server and issue a command. my question is what should I do if I want to
connect to more than one ssh server.
I did try to create more than one SimpleTransport by using the following
HOSTS=[host1, host2, host3]
protocol.ClientCreator(reactor, SimpleTransport).connectTCP(host1, 22)
protocol.ClientCreator(reactor, SimpleTransport).connectTCP(host2, 22)
protocol.ClientCreator(reactor, SimpleTransport).connectTCP(host3, 22)
this really behaves as what i expected, and executed the command on all
remote hosts, but after it finishes, i just hangs there, I know I need a
place to call something like reactor.stop() when all transport finishes the
execution. but i do not know where to call it, need some deffereds? and
thanks very much!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Twisted-Python