Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Trunk #1

Closed
wants to merge 1 commit into from

3 participants

@alexkv

Added tcp connection closing.
In case of a greate number of requests no close connection led to a bug.

@alexkv alexkv modified: lib/xmlrpc/client.rb
Added tcp connection closing.
In case of a greate number of requests no close connection led to a bug.
e3eb024
@shyouhei
Owner

Hi. Is there any code to reproduce that bug? I want one (if any) because I just want to write a test case on it.

@alexkv

Hi. You can try this one.

Dummy server:


#!/usr/bin/ruby
require "xmlrpc/server"

s = XMLRPC::Server.new(8080) 
s.add_handler("dummy") do |a|
    'Yeah'
end
s.serve

Client:


#!/usr/bin/ruby

require 'xmlrpc/client'
1000.times{
    result = XMLRPC::Client.new2('http://localhost:8080/').call( 'dummy', ['Are you here?'])
    p result
}
@shyouhei
Owner

Hi, we are discussing this. Please stay tuned…

@nahi
Collaborator

Sorry for late reply.

Axy, you can use call_async instead of call for such case (non Keep-Alive TCP connection which is closed per connection.)
Yeah, I think that method name is awfully confusing but we don't want to touch xmlrpc lib as far as possible.

@alexkv
@shyouhei shyouhei closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 19, 2010
  1. @alexkv

    modified: lib/xmlrpc/client.rb

    alexkv authored
    Added tcp connection closing.
    In case of a greate number of requests no close connection led to a bug.
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 0 deletions.
  1. +1 −0  lib/xmlrpc/client.rb
View
1  lib/xmlrpc/client.rb
@@ -536,6 +536,7 @@ def do_rpc(request, async=false)
# post request
resp = @http.post2(@path, request, header)
+ @http.finish
end
@http_last_response = resp
Something went wrong with that request. Please try again.