[Twisted-Python] What deferred can I use to detect when a server or client is "running"

Brian Granger ellisonbg.net at gmail.com
Sun Dec 17 15:10:34 MST 2006


Hi,

i am writing some tests using trial and in my setUp methods I start
various servers and clients using listenTCP/connectTCP.  The problem I
am having is finding a deferred that will fire when:

1.  A server is actually listening.  I want to use this deferred to
trigger clients to connect...

2.  A client has connected.  I want to return this deferred from my
setUp method so my tests won't actually run until the client has
connected to the server.

I have some hackish ways that I have been getting around this, but
they seem a little fickle.  What is the "standard" way of doing this
in tests?

Thanks

Brian




More information about the Twisted-Python mailing list