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

月忧茗 yueyoum at gmail.com
Sat Feb 4 01:12:32 EST 2012


Sorry,

It should be this:


application = service.Application('finger')
f = FingerService()
f.setServiceParent(application)

serviceCollection = service.IServiceCollection(application)
internet.TCPServer(9000, f.get_FingerFactory()
                            ).setServiceParent(serviceCollection)


2012/2/4 月忧茗 <yueyoum at gmail.com>

>
> 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/a3817097/attachment.htm 


More information about the Twisted-Python mailing list