summaryrefslogtreecommitdiff
path: root/lib/net/smtp.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-04-11 21:20:51 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-04-11 21:20:51 +0000
commitea9b6997cc8bcb70ea82cb0535d1a4b5a5fd5508 (patch)
tree653d33c610a24bf88158e7cc899e3b366a8a46d1 /lib/net/smtp.rb
parent8c5c5a221f3bd3b0bdf6304b924630c35c7f8631 (diff)
* lib/net/protocol.rb (module Net): Added ReadTimeout to match
OpenTimeout. ReadTimeout is now raised by rbuf_fill instead of Timeout::Error to help users distinguish what type of timeout occurred. [ruby-trunk - Feature #6088] * lib/net/pop.rb (module Net): Updated documentation for ReadTimeout and OpenTimeout. * lib/net/http.rb (module Net): ditto * lib/net/smtp.rb (module Net): ditto * lib/net/telnet.rb (module Net): Net::ReadTimeout is now raised in waitfor to match Net::Protocol. * test/net/http/test_http.rb: Updated Timeout::Error expectation to Net::ReadTimeout. * test/net/ftp/test_ftp.rb: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35304 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/net/smtp.rb')
-rw-r--r--lib/net/smtp.rb14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/net/smtp.rb b/lib/net/smtp.rb
index 2d4c0eae6d..feab4b3a0b 100644
--- a/lib/net/smtp.rb
+++ b/lib/net/smtp.rb
@@ -364,12 +364,12 @@ module Net
# Seconds to wait while attempting to open a connection.
# If the connection cannot be opened within this time, a
- # TimeoutError is raised.
+ # Net::OpenTimeout is raised.
attr_accessor :open_timeout
# Seconds to wait while reading one block (by one read(2) call).
# If the read(2) call does not complete within this time, a
- # TimeoutError is raised.
+ # Net::ReadTimeout is raised.
attr_reader :read_timeout
# Set the number of seconds to wait until timing-out a read(2)
@@ -448,8 +448,9 @@ module Net
# * Net::SMTPSyntaxError
# * Net::SMTPFatalError
# * Net::SMTPUnknownError
+ # * Net::OpenTimeout
+ # * Net::ReadTimeout
# * IOError
- # * TimeoutError
#
def SMTP.start(address, port = nil, helo = 'localhost',
user = nil, secret = nil, authtype = nil,
@@ -509,8 +510,9 @@ module Net
# * Net::SMTPSyntaxError
# * Net::SMTPFatalError
# * Net::SMTPUnknownError
+ # * Net::OpenTimeout
+ # * Net::ReadTimeout
# * IOError
- # * TimeoutError
#
def start(helo = 'localhost',
user = nil, secret = nil, authtype = nil) # :yield: smtp
@@ -653,8 +655,8 @@ module Net
# * Net::SMTPSyntaxError
# * Net::SMTPFatalError
# * Net::SMTPUnknownError
+ # * Net::ReadTimeout
# * IOError
- # * TimeoutError
#
def send_message(msgstr, from_addr, *to_addrs)
raise IOError, 'closed session' unless @socket
@@ -706,8 +708,8 @@ module Net
# * Net::SMTPSyntaxError
# * Net::SMTPFatalError
# * Net::SMTPUnknownError
+ # * Net::ReadTimeout
# * IOError
- # * TimeoutError
#
def open_message_stream(from_addr, *to_addrs, &block) # :yield: stream
raise IOError, 'closed session' unless @socket