# File lib/bunny/client09.rb, line 57
                def check_response(received_method, expected_method, err_msg, err_class = Bunny::ProtocolError)
                        case
                                when received_method.is_a?(Qrack::Protocol09::Connection::Close)
                                        # Clean up the socket
                                        close_socket

                                        raise Bunny::ForcedConnectionCloseError,
                                                "Error Reply Code: #{received_method.reply_code}\nError Reply Text: #{received_method.reply_text}"

                                when received_method.is_a?(Qrack::Protocol09::Channel::Close)
                                        # Clean up the channel
                                        channel.active = false

                                        raise Bunny::ForcedChannelCloseError,
                                                "Error Reply Code: #{received_method.reply_code}\nError Reply Text: #{received_method.reply_text}"

                                when !received_method.is_a?(expected_method)
                                        raise err_class, err_msg

                                else
                                        :response_ok
                        end
                end