From: Grigory Petrov Date: 2012-02-18T17:59:32+09:00 Subject: Re: How to shutdown Ruby XMLRPC server? Sorry, my english is not very good :(. What do you mean by both "nothing wrong" and "i can repro your issue" statements? If you can reproduce my issue, it clearly states what is wrong: XMLRPC server simply don't shutdown O_O. Of course it will shutdown if no clients are connected. But seems that it can't shutdown if client is connected :( On Sat, Feb 18, 2012 at 5:13 AM, Ryan Davis wrote: > > On Feb 17, 2012, at 10:04 , Grigory Petrov wrote: > >> Hello. I'm testing Ruby XMLRPC support right now. All works fine, >> except XMLRPC::Server#shutdown :( If i run following ruby 1.9.3 test >> code, it fails to shutdown server on both Windows 7 and OSX 10.7: >> >> # server.rb >> >> require "xmlrpc/server" >> require 'thread' >> Thread.new { sleep 10; $server.shutdown() } >> $server = XMLRPC::Server.new( 1234 ) >> $server.add_handler( "test" ) { true } >> $server.serve() >> >> # client.rb >> >> require "xmlrpc/client" >> server = XMLRPC::Client.new( "localhost", "/", 1234 ) >> loop { server.call( "test" ); sleep 0.1 } >> >> After 10 seconds the server writes "INFO  going to shutdown ..." to >> stdout, but don't actually shut down and continues to handle incoming >> requests :(. What i'm doing wrong? > > Nothing wrong that I can see. I can repro your issue as well. XMLRPC::Server#shutdown just calls shutdown on the webrick server and I use that all the time like so: > > trap("INT") { s.shutdown } > > >