[Twisted-Python] help me on startService ( service.Service )

月忧茗 yueyoum at gmail.com
Fri Feb 3 01:11:46 EST 2012


Thanks for reply

Yes, of course.

I followed the turotial ,




_______________________________


class FingerService(service.Service):
    ...
    def startService(self):
        print 'start service'
        ....

application = service.Application('finger')
f = FingerService()
serviceCollection = service.IServiceCollection(application)
internet.TCPServer(9000, f.get_FingerFactory()
                            ).setServiceParent(serviceCollection)






2012/2/3 <exarkun at twistedmatrix.com>

> On 01:43 am, yueyoum at gmail.com wrote:
> >Hi, all
> >
> >I'm a new guy for twisted,
> >I just study the example of finger14.tac
> >at this page :
> >
> http://twistedmatrix.com/documents/current/core/howto/tutorial/protocol.html
> >
> >But,  *startService* not called when program running.
>
> Services are only started if they're added to the application object.
> Did you use setServiceParent to make the application object the parent
> of your service?
>
> Jean-Paul
>
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20120203/6e1c20cb/attachment.htm 


More information about the Twisted-Python mailing list