# File lib/net/imap.rb, line 289def disconnectbeginbegin# try to call SSL::SSLSocket#io.@sock.io.shutdownrescueNoMethodError# @sock is not an SSL::SSLSocket.@sock.shutdownendrescueErrno::ENOTCONN# ignore `Errno::ENOTCONN: Socket is not connected' on some platforms.end@receiver_thread.join@sock.closeend