[Twisted-Python] listenTCP in a TAC

I've got a server application that listens on a port, and when clients connect, spawns another TCP service on a random port that can live from a few seconds, up to a day or two. I had some problems getting this to work with twisted.application.internet.TCPServer (my services wouldn't stop listening when I'd finished with them) but it's working ok with plain old reactor.listenTCP. I don't really grok the TAC thing yet, or why there's a different method for spawning servers within an Application. Is my listenTCP approach bad practice for some reason that's not apparent to me? Thanks! Donal

you can call 'disownServiceParent' when you don't want them to be in service any more. That will cause it to stop listening. http://twistedmatrix.com/documents/10.0.0/api/twisted.application.service.Se... On Tue, May 11, 2010 at 5:47 PM, Donal McMullan <donal.mcmullan@gmail.com>wrote:
-- Thanks & Regards, Godson Gera IVR India <http://godson.in>

Hi Godson - thanks for the reply... I had tried disowning the parent. I was actually getting unexpected behaviour on setServiceParent, but that's another story. I'll try again with TCPServer tomorrow, but for now I'm just keen to know if there are any bad interactions between Applications and listenTCP. Thanks D On 12 May 2010 00:44, Godson Gera <godson.g@gmail.com> wrote:

On Wed, 2010-05-12 at 00:17 +1200, Donal McMullan wrote:
Services are things that can be started and stopped, that's all. Typically you'd write your own custom logic here, but Twisted also provides wrappers around listenTCP and friends to make them look like Services. You don't have to use them if you don't want to.

you can call 'disownServiceParent' when you don't want them to be in service any more. That will cause it to stop listening. http://twistedmatrix.com/documents/10.0.0/api/twisted.application.service.Se... On Tue, May 11, 2010 at 5:47 PM, Donal McMullan <donal.mcmullan@gmail.com>wrote:
-- Thanks & Regards, Godson Gera IVR India <http://godson.in>

Hi Godson - thanks for the reply... I had tried disowning the parent. I was actually getting unexpected behaviour on setServiceParent, but that's another story. I'll try again with TCPServer tomorrow, but for now I'm just keen to know if there are any bad interactions between Applications and listenTCP. Thanks D On 12 May 2010 00:44, Godson Gera <godson.g@gmail.com> wrote:

On Wed, 2010-05-12 at 00:17 +1200, Donal McMullan wrote:
Services are things that can be started and stopped, that's all. Typically you'd write your own custom logic here, but Twisted also provides wrappers around listenTCP and friends to make them look like Services. You don't have to use them if you don't want to.
participants (3)
-
Donal McMullan
-
Godson Gera
-
Itamar Turner-Trauring