From 7fd8040c7817540f4175c13e6664a463cffdcbdb Mon Sep 17 00:00:00 2001 From: kazu Date: Fri, 22 Aug 2008 11:12:06 +0000 Subject: * lib/webrick/server.rb (WEBrick::GenericServer#shutdown): rescue Errno::ENOTCONN and close. [ruby-dev:35896] * test/openssl/test_ssl.rb (OpenSSL#start_server): ditto. [ruby-dev:35897] * lib/net/imap.rb (Net::IMAP#disconnect): ditto. [ruby-dev:35898] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18777 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/net/imap.rb | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'lib/net') diff --git a/lib/net/imap.rb b/lib/net/imap.rb index 64011e69c..e6ffa3b1e 100644 --- a/lib/net/imap.rb +++ b/lib/net/imap.rb @@ -288,11 +288,15 @@ module Net # Disconnects from the server. def disconnect begin - # try to call SSL::SSLSocket#io. - @sock.io.shutdown - rescue NoMethodError - # @sock is not an SSL::SSLSocket. - @sock.shutdown + begin + # try to call SSL::SSLSocket#io. + @sock.io.shutdown + rescue NoMethodError + # @sock is not an SSL::SSLSocket. + @sock.shutdown + end + rescue Errno::ENOTCONN + # ignore `Errno::ENOTCONN: Socket is not connected' on some platforms. end @receiver_thread.join @sock.close -- cgit