Object
# File lib/excon/socket.rb, line 66 def legacy_readline begin Timeout.timeout(@data[:read_timeout]) do @socket.readline end rescue Timeout::Error raise Excon::Errors::Timeout.new('read timeout reached') end end
# File lib/excon/socket.rb, line 84 def local_address unpacked_sockaddr[1] end
# File lib/excon/socket.rb, line 88 def local_port unpacked_sockaddr[0] end
# File lib/excon/socket.rb, line 9 def params Excon.display_warning('Excon::Socket#params is deprecated use Excon::Socket#data instead.') @data end
# File lib/excon/socket.rb, line 14 def params=(new_params) Excon.display_warning('Excon::Socket#params= is deprecated use Excon::Socket#data= instead.') @data = new_params end
# File lib/excon/socket.rb, line 31 def read(max_length = nil) if @eof return max_length ? nil : '' elsif @nonblock read_nonblock(max_length) else read_block(max_length) end end
# File lib/excon/socket.rb, line 41 def readline return legacy_readline if RUBY_VERSION.to_f <= 1.8_7 buffer = '' begin buffer << @socket.read_nonblock(1) while buffer[-1] != "\n" buffer rescue Errno::EAGAIN, Errno::EWOULDBLOCK, IO::WaitReadable if timeout_reached('read') raise_timeout_error('read') else retry end rescue OpenSSL::SSL::SSLError => e if e.message == 'read would block' if timeout_reached('read') raise_timeout_error('read') else retry end else raise(error) end end end
Generated with the Darkfish Rdoc Generator 2.