[Twisted-Python] How to stop a TCP server without stoping the reactor?

Johann Borck johann.borck at densedata.com
Thu May 11 11:47:46 MDT 2006


xuan tang wrote:

> I am trying to create a TCP server using twisted reactor. I want to
> stop the server from accepting TCP bind requests (and restart it
> later), but for some reason I don't want to use reactor.stop(). Is
> there another way to do it?

reactor.listenXXX returns the an IListeningPort-implementing object on
which you can call stopListening() and startListening(). When you're
using the twisted.application stuff you can call
stopService()/startService() on your Service instance.

Johann





More information about the Twisted-Python mailing list