File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -1036,6 +1036,7 @@ def ipaddr=(addr)
1036
1036
#
1037
1037
# Argument +retries+ must be a non-negative numeric value:
1038
1038
#
1039
+ # http = Net::HTTP.new(hostname)
1039
1040
# http.max_retries = 2 # => 2
1040
1041
# http.max_retries # => 2
1041
1042
#
@@ -1049,13 +1050,27 @@ def max_retries=(retries)
1049
1050
1050
1051
attr_reader :max_retries
1051
1052
1052
- # Setter for the read_timeout attribute.
1053
+ # Sets the read timeout, in seconds, for +self+ to integer +sec+;
1054
+ # the initial value is 60.
1055
+ #
1056
+ # Argument +sec+ must be a non-negative numeric value:
1057
+ #
1058
+ # http = Net::HTTP.new(hostname)
1059
+ # http.read_timeout # => 60
1060
+ # http.get('/todos/1') # => #<Net::HTTPOK 200 OK readbody=true>
1061
+ # http.read_timeout = 0
1062
+ # http.get('/todos/1') # Raises Net::ReadTimeout.
1063
+ #
1053
1064
def read_timeout = ( sec )
1054
1065
@socket . read_timeout = sec if @socket
1055
1066
@read_timeout = sec
1056
1067
end
1057
1068
1058
- # Setter for the write_timeout attribute.
1069
+ # Sets the write timeout, in seconds, for +self+ to integer +sec+;
1070
+ # the initial value is 60.
1071
+ #
1072
+ # Argument +sec+ must be a non-negative numeric value.
1073
+ #
1059
1074
def write_timeout = ( sec )
1060
1075
@socket . write_timeout = sec if @socket
1061
1076
@write_timeout = sec
You can’t perform that action at this time.
0 commit comments