From: Ryan Davis Date: 2012-02-18T10:13:05+09:00 Subject: Re: How to shutdown Ruby XMLRPC server? 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 }