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

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. Please help, thanks. Code like bellow: class FingerService(service.Service): ... def startService(self): print 'start service' self.test_call() service.Service.startService(self) Noting output ,and test_call() not called.

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@twistedmatrix.com>

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@gmail.com>

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@twistedmatrix.com>

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@gmail.com>
participants (3)
-
exarkun@twistedmatrix.com
-
Itamar Turner-Trauring
-
月忧茗