Class: DRb::HTTP0::ClientSide
- Inherits:
-
Object
- Object
- DRb::HTTP0::ClientSide
- Defined in:
- lib/drb/http0.rb
Instance Method Summary collapse
- #alive? ⇒ Boolean
- #close ⇒ Object
-
#initialize(uri, config) ⇒ ClientSide
constructor
A new instance of ClientSide.
- #post(url, data) ⇒ Object
- #recv_reply ⇒ Object
- #send_request(ref, msg_id, *arg, &b) ⇒ Object
Constructor Details
#initialize(uri, config) ⇒ ClientSide
Returns a new instance of ClientSide.
41 42 43 44 45 46 47 |
# File 'lib/drb/http0.rb', line 41 def initialize(uri, config) @uri = uri @res = nil @config = config @msg = DRbMessage.new(config) @proxy = ENV['HTTP_PROXY'] end |
Instance Method Details
#alive? ⇒ Boolean
50 |
# File 'lib/drb/http0.rb', line 50 def alive?; false; end |
#close ⇒ Object
49 |
# File 'lib/drb/http0.rb', line 49 def close; end |
#post(url, data) ⇒ Object
63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/drb/http0.rb', line 63 def post(url, data) it = URI.parse(url) path = [(it.path=='' ? '/' : it.path), it.query].compact.join('?') http = Net::HTTP.new(it.host, it.port) sio = StrStream.new http.post(path, data, {'Content-Type'=>'application/octetstream;'}) do |str| sio.write(str) if @config[:load_limit] < sio.buf.size raise TypeError, 'too large packet' end end @reply_stream = sio end |
#recv_reply ⇒ Object
59 60 61 |
# File 'lib/drb/http0.rb', line 59 def recv_reply @msg.recv_reply(@reply_stream) end |