lib/rtsp/client.rb
# Executes the Request with the arguments passed in, yields the response to
# the calling block, checks the CSeq response and the session response,
# then increments +@cseq+ by 1.  Handles any exceptions raised during the
# Request.
#
# @param [RTSP::Message] message
# @yield [RTSP::Response]
# @return [RTSP::Response]
# @raise [RTSP::Error] All 4xx & 5xx response codes & their messages.
Executes the Request with the arguments passed in, yields the response to
the calling block, checks the CSeq response and the session response,
then increments +@cseq+ by 1.  Handles any exceptions raised during the
Request.
Executes the Request with the arguments passed in yields the response to the calling block checks the CSeq response and the session response then increments + @cseq + by 1 . Handles any exceptions raised during the Request .
def request message
      response = send_message message
      if response.code == 401
        auth_message = get_authorization(message, response)
        if not auth_message.nil?
          message = auth_message
          response = send_message auth_message
        end
      end
      @cseq += 1
      if response.code.to_s =~ /2../
        yield response if block_given?
      elsif response.code.to_s =~ /(4|5)../
        if (defined? response.connection) && response.connection == 'Close'
          reset_state
        end
        raise RTSP::Error, "#{response.code}: #{response.message}"
      else
        raise RTSP::Error, "Unknown Response code: #{response.code}"
      end
      dont_ensure_list = [:options, :describe, :teardown, :set_parameter,
          :get_parameter]
      unless dont_ensure_list.include? message.method_type
        ensure_session
      end
      response
    end
def request message response = send_message message if response . code == 401 auth_message = get_authorization ( message , response ) if not auth_message . nil? message = auth_message response = send_message auth_message end end @cseq += 1 if response . code . to_s =~ / 2.. / yield response if block_given? elsif response . code . to_s =~ / (4|5).. / if ( defined? response . connection ) && response . connection == 'Close' reset_state end raise RTSP :: Error , "#{response.code}: #{response.message}" else raise RTSP :: Error , "Unknown Response code: #{response.code}" end dont_ensure_list = [ :options , :describe , :teardown , :set_parameter , :get_parameter ] unless dont_ensure_list . include? message . method_type ensure_session end response end
Executes the Request with the arguments passed in, yields the response to
the calling block, checks the CSeq response and the session response,
then increments +@cseq+ by 1.
Executes the Request with the arguments passed in yields the response to the calling block checks the CSeq response and the session response then increments + @cseq + by 1 .
#compare_sequence_number response.cseq
None
RTSP::Response
[RTSP::Error] All 4xx & 5xx response codes & their messages.
[ RTSP :: Error ] All 4xx & 5xx response codes & their messages .
message
None
]
None