[Twisted-Python] help me on startService ( service.Service )
月忧茗
yueyoum at gmail.com
Sat Feb 4 01:05:18 EST 2012
Oh, Thanks !
It works!
application = service.Application('finger')
f = FingerService()
f.setServiceParent(application)
internet.TCPServer(9000, f.get_FingerFactory())
2012/2/4 <exarkun at twistedmatrix.com>
> On 06:11 am, yueyoum at gmail.com wrote:
> >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)
>
> Notice that nowhere here does `f` get attached to `application`. You
> need this:
>
> f.setServiceParent(application)
>
> 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/20120204/099d177d/attachment.htm
More information about the Twisted-Python
mailing list