]On 12/5/05, Suet Lung Cheung <[EMAIL PROTECTED]> wrote:
> Hi Paul,
>      Thanks for your reply again. Your example works for me. I found the
> difference. I use a serviceCollection to include my service. Does it mean
> anything? my code is in this way...
>  application = service.Application('chatroom')
>
>  f = ChatService()
>  serviceCollection = service.IServiceCollection(application)
>  internet.TCPServer (1234,
> ChatFactoryFromService(f)).setServiceParent(serviceCollection)
>
> and I have implemented stopService() in ChatService. Is it different if I
> use serviceCollection? Thanks again.

It looks like the problem here is that you're not setting your
ChatService's service parent to the application (by the way, you don't
need to adapt to IServiceCollection - setServiceParent tries to adapt
to IServiceCollection itself).

application = service.Application('chatroom')
f = ChatService()
f.setServiceParent(application)
...

should sort you out.



--
  Twisted   |  Christopher Armstrong: International Man of Twistery
   Radix    |    -- http://radix.twistedmatrix.com
            |  Release Manager, Twisted Project
  \\\V///   |    -- http://twistedmatrix.com
   |o O|    |
w----v----w-+

_______________________________________________
Twisted-web mailing list
[email protected]
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web

Reply via email to