Ruby的XMLRPC :: Client是否有调用大小限制?

时间:2013-03-25 14:06:52

标签: ruby xml-rpc

我在Ruby中使用XMLRPC::Client(ruby 1.8到2.0的相同行为),用于向服务器发送调用,如下所示:

server = XMLRPC::Client.new2( url )
server.timeout = 300
response = server.call( "service.methodname", bigarray )

一切正常,只要传递的bigarray不是太大。从它包含大约10K浮点数的那一刻起,我得到以下错误跟踪:

$ ruby client_largeinputset.rb 
/Users/aliekens/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/net/protocol.rb:153:in `read_nonblock': Connection reset by peer (Errno::ECONNRESET)
from /Users/aliekens/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/net/protocol.rb:153:in `rbuf_fill'
from /Users/aliekens/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/net/protocol.rb:122:in `read_all'
from /Users/aliekens/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/net/http/response.rb:292:in `block in read_body_0'
from /Users/aliekens/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/net/http/response.rb:269:in `inflater'
from /Users/aliekens/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/net/http/response.rb:274:in `read_body_0'
from /Users/aliekens/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/net/http/response.rb:201:in `read_body'
from /Users/aliekens/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/net/http/response.rb:226:in `body'
from /Users/aliekens/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/net/http/response.rb:163:in `reading_body'
from /Users/aliekens/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/net/http.rb:1411:in `block in transport_request'
from /Users/aliekens/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/net/http.rb:1402:in `catch'
from /Users/aliekens/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/net/http.rb:1402:in `transport_request'
from /Users/aliekens/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/net/http.rb:1375:in `request'
from /Users/aliekens/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/net/http.rb:1321:in `request_post'
from /Users/aliekens/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/xmlrpc/client.rb:477:in `do_rpc'
from /Users/aliekens/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/xmlrpc/client.rb:281:in `call2'
from /Users/aliekens/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/xmlrpc/client.rb:262:in `call'
from client_largeinputset.rb:28:in `<main>'

我不知道XMLRPC规范中的调用大小限制,但在我的工作流程中似乎存在限制。

首先关闭:这是我的ruby客户端问题还是我的服务器问题(用xmlrpc-c编写,通过Abyss HTTP服务器)可能不接受大请求?

如果是在客户端,那么有办法解决这个问题吗?我可以在客户端更改呼叫请求的大小(如果有限制)?是否有任何替代路由(除了ruby的原生XMLRPC :: Client实现)可以绕过这个问题?最好是我正在寻找一种解决方案,在客户端解决这个问题,而不必调整服务器端,除非它确实是服务器大小的问题。

0 个答案:

没有答案