Thanks everybody, finally I've made it call the stopService(). However even I return a deferred in the stopService, it still quit before the callback is called. Can anyone give me an example of returning a deferred in stopService()? Thanks anyone.
Christopher Armstrong <[EMAIL PROTECTED]> 說:
Christopher Armstrong <[EMAIL PROTECTED]> 說:
]On 12/5/05, Suet Lung Cheungwrote:
> 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
_______________________________________
褩����洘 - Yahoo! Messenger
憩呾斕�]衄奻鋒ㄛ斕腔攬衭゛褫眕隱狟��洘緻斕ㄛ��斕奻鋒�r憩夔蕾撈艘善ㄛ¦睡挲��飲�衿萯均�
http://messenger.yahoo.com.hk
_______________________________________________ Twisted-web mailing list [email protected] http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
