Skip to content

Commit 48285b8

Browse files
authored
Merge pull request #17 from ruby/revert-3-patch-1
Revert "Replace Timeout.timeout with socket timeout"
2 parents c32b41b + 7be45bb commit 48285b8

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

lib/net/pop.rb

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -540,11 +540,8 @@ def start(account, password) # :yield: pop
540540

541541
# internal method for Net::POP3.start
542542
def do_start(account, password) # :nodoc:
543-
begin
544-
s = Socket.tcp @address, port, nil, nil, connect_timeout: @open_timeout
545-
rescue Errno::ETIMEDOUT #raise Net:OpenTimeout instead for compatibility with previous versions
546-
raise Net::OpenTimeout, "Timeout to open TCP connection to "\
547-
"#{@address}:#{port} (exceeds #{@open_timeout} seconds)"
543+
s = Timeout.timeout(@open_timeout, Net::OpenTimeout) do
544+
TCPSocket.open(@address, port)
548545
end
549546
if use_ssl?
550547
raise 'openssl library not installed' unless defined?(OpenSSL)

0 commit comments

Comments
 (0)