<div id="RTEContent">Hi Paul,<br> &nbsp;&nbsp;&nbsp; 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...<br> application = service.Application('chatroom')<br> <br> f = ChatService()<br> serviceCollection = service.IServiceCollection(application)<br> internet.TCPServer (1234, ChatFactoryFromService(f)).setServiceParent(serviceCollection)<br> <br>and I have implemented stopService() in ChatService. Is it different if I use serviceCollection? Thanks again.<br> <br> Snow Dragon<br> <br><b><i>Jean-Paul Calderone &lt;exarkun@divmod.com&gt;</i></b> 弧<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> On Mon, 5 Dec 2005 11:52:11 +0800 (CST), Suet Lung Cheung <suetlung2003 @yahoo.com.hk=""> wrote:<br>&gt;Hi Paul,<br>&gt; Thanks for your help. However it seems doesn't work. When I press Ctrl-C, it even
 doesn't call the stopService() function. I print a "Hello World" inside the function but it doesn't say hello to the world. And I've tried returning a Deferred from this function. However it quit before the callback is called. Can u give advice on this? Do u know where can I find some example about this? Thanks a lot.<br>&gt;<br>&gt; Snow Dragon<br>&gt;<br><br>exarkun@boson:~$ cat &gt; stop-service.py<br>from twisted.application import service<br>application = service.Application("stop-service demo")<br><br>class Demo(service.Service):<br>  def stopService(self):<br>    print "Stopping!"<br>Demo().setServiceParent(application)<br>exarkun@boson:~$ twistd -noy stop-service.py <br>2005/12/05 00:23 EST [-] Log opened.<br>2005/12/05 00:23 EST [-] twistd SVN-Trunk (/usr/bin/python 2.4.2) starting up<br>2005/12/05 00:23 EST [-] reactor class: twisted.internet.selectreactor.SelectReactor<br>2005/12/05 00:23 EST [-] Loading stop-service.py...<br>2005/12/05 00:23 EST [-] Loaded.<br>2005/12/05
 00:23 EST [-] Received SIGINT, shutting down.<br>2005/12/05 00:23 EST [-] Stopping!       &lt; - - - - - - - - - stopService<br>2005/12/05 00:23 EST [-] Main loop terminated.<br>2005/12/05 00:23 EST [-] Server Shut Down.<br>exarkun@boson:~$ <br><br>Jean-Paul<br><br>_______________________________________________<br>Twisted-web mailing list<br>Twisted-web@twistedmatrix.com<br>http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web<br></suetlung2003></blockquote><br></div><p>_______________________________________<br> 離線訊息 - Yahoo! Messenger<br> 就算你沒有上網,你的朋友仍可以留下訊息給你,當你上網時就能立即看到,任何說話都冇走失。<br>  http://messenger.yahoo.com.hk