@@ -775,7 +775,7 @@ class << self
775
775
# Seconds to wait until a connection is opened.
776
776
# If the IMAP object cannot open a connection within this time,
777
777
# it raises a Net::OpenTimeout exception. The default value is 30 seconds.
778
- attr_reader : open_timeout
778
+ def open_timeout ; config . open_timeout end
779
779
780
780
# Seconds to wait until an IDLE response is received.
781
781
attr_reader :idle_response_timeout
@@ -825,13 +825,14 @@ class << self
825
825
# config object for inheritance. Every Net::IMAP client has its own
826
826
# unique #config for overrides.
827
827
#
828
- # [open_timeout]
829
- # Seconds to wait until a connection is opened
830
828
# [idle_response_timeout]
831
829
# Seconds to wait until an IDLE response is received
832
830
#
833
831
# Any other keyword arguments will be forwarded to Config.new, to create the
834
- # client's #config.
832
+ # client's #config. For example:
833
+ #
834
+ # [open_timeout]
835
+ # Seconds to wait until a connection is opened
835
836
#
836
837
# See DeprecatedClientOptions.new for deprecated arguments.
837
838
#
@@ -889,14 +890,13 @@ class << self
889
890
# Connected to the host successfully, but it immediately said goodbye.
890
891
#
891
892
def initialize ( host , port : nil , ssl : nil ,
892
- open_timeout : 30 , idle_response_timeout : 5 ,
893
+ idle_response_timeout : 5 ,
893
894
config : Config . global , **config_options )
894
895
super ( )
895
896
# Config options
896
897
@host = host
897
898
@config = Config . new ( config , **config_options )
898
899
@port = port || ( ssl ? SSL_PORT : PORT )
899
- @open_timeout = Integer ( open_timeout )
900
900
@idle_response_timeout = Integer ( idle_response_timeout )
901
901
@ssl_ctx_params , @ssl_ctx = build_ssl_ctx ( ssl )
902
902
@@ -2636,12 +2636,12 @@ def start_receiver_thread
2636
2636
end
2637
2637
2638
2638
def tcp_socket ( host , port )
2639
- s = Socket . tcp ( host , port , :connect_timeout => @ open_timeout)
2639
+ s = Socket . tcp ( host , port , :connect_timeout => open_timeout )
2640
2640
s . setsockopt ( :SOL_SOCKET , :SO_KEEPALIVE , true )
2641
2641
s
2642
2642
rescue Errno ::ETIMEDOUT
2643
2643
raise Net ::OpenTimeout , "Timeout to open TCP connection to " +
2644
- "#{ host } :#{ port } (exceeds #{ @ open_timeout} seconds)"
2644
+ "#{ host } :#{ port } (exceeds #{ open_timeout } seconds)"
2645
2645
end
2646
2646
2647
2647
def receive_responses
@@ -2959,7 +2959,7 @@ def start_tls_session
2959
2959
@sock = SSLSocket . new ( @sock , ssl_ctx )
2960
2960
@sock . sync_close = true
2961
2961
@sock . hostname = @host if @sock . respond_to? :hostname=
2962
- ssl_socket_connect ( @sock , @ open_timeout)
2962
+ ssl_socket_connect ( @sock , open_timeout )
2963
2963
if ssl_ctx . verify_mode != VERIFY_NONE
2964
2964
@sock . post_connection_check ( @host )
2965
2965
@tls_verified = true
0 commit comments