Class: Net::HTTPGenericRequest::Chunker
Do not use. This class is for internal use only.
Relationships & Source Files | |
Inherits: | Object |
Defined in: | lib/net/http/generic_request.rb |
Class Method Summary
- .new(sock) ⇒ Chunker constructor
Instance Method Summary
Constructor Details
.new(sock) ⇒ Chunker
# File 'lib/net/http/generic_request.rb', line 164
def initialize(sock) @sock = sock @prev = nil end
Instance Method Details
#finish
[ GitHub ]# File 'lib/net/http/generic_request.rb', line 177
def finish @sock.write("0\r\n\r\n") end
#write(buf)
[ GitHub ]# File 'lib/net/http/generic_request.rb', line 169
def write(buf) # avoid memcpy() of buf, buf can huge and eat memory bandwidth @sock.write("#{buf.bytesize.to_s(16)}\r\n") rv = @sock.write(buf) @sock.write("\r\n") rv end