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 月忧茗 <yuey...@gmail.com>

>
> Oh,  Thanks !
> It works!
>
>
> application = service.Application('finger')
> f = FingerService()
> f.setServiceParent(application)
> internet.TCPServer(9000, f.get_FingerFactory())
>
>
>
>
> 2012/2/4 <exar...@twistedmatrix.com>
>
> On 06:11 am, yuey...@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@twistedmatrix.com
>> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>>
>
>
_______________________________________________
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Reply via email to