I am using the Ruby standard library to create persistent connect:
Net::HTTP.new(host, port)
Does ruby close the connection itself after idle for some times?
Yes. The default for MRI Ruby is 60 seconds.
http = Net::HTTP.new(host, port)
http.read_timeout # -> 60
If you want a connection does not timeout you can set read_timeout
to nil
http.read_timeout = nil
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With