Class: RTSP::Request
- Inherits:
-
Object
- Object
- RTSP::Request
- Extended by:
- Global
- Includes:
- Common
- Defined in:
- lib/rtsp/request.rb
Overview
Parses raw request data from the server/client and turns it into attr_readers.
Constant Summary
Constants included from Global
Global::DEFAULT_RTSP_PORT, Global::DEFAULT_VERSION
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#remote_host ⇒ Object
Returns the value of attribute remote_host.
-
#rtsp_version ⇒ Object
readonly
Returns the value of attribute rtsp_version.
-
#stream_index ⇒ Object
readonly
Returns the value of attribute stream_index.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Attributes included from Global
#log, #log_level, #logger, #raise_errors
Instance Method Summary collapse
-
#initialize(raw_request, remote_host) ⇒ Request
constructor
server/client.
Methods included from Global
log?, raise_errors?, reset_config!
Methods included from Common
#extract_status_line, #inspect, #multicast?, #parse_body, #parse_head, #split_head_and_body_from, #to_s, #transport_url
Constructor Details
#initialize(raw_request, remote_host) ⇒ Request
server/client.
26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/rtsp/request.rb', line 26 def initialize(raw_request, remote_host) if raw_request.nil? || raw_request.empty? raise RTSP::Error, "#{self.class} received nil or empty string--this shouldn't happen." end @raw_body = raw_request @remote_host = remote_host head, body = split_head_and_body_from @raw_body parse_head(head) end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
18 19 20 |
# File 'lib/rtsp/request.rb', line 18 def body @body end |
#code ⇒ Object (readonly)
Returns the value of attribute code.
16 17 18 |
# File 'lib/rtsp/request.rb', line 16 def code @code end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
17 18 19 |
# File 'lib/rtsp/request.rb', line 17 def @message end |
#remote_host ⇒ Object
Returns the value of attribute remote_host.
21 22 23 |
# File 'lib/rtsp/request.rb', line 21 def remote_host @remote_host end |
#rtsp_version ⇒ Object (readonly)
Returns the value of attribute rtsp_version.
15 16 17 |
# File 'lib/rtsp/request.rb', line 15 def rtsp_version @rtsp_version end |
#stream_index ⇒ Object (readonly)
Returns the value of attribute stream_index.
20 21 22 |
# File 'lib/rtsp/request.rb', line 20 def stream_index @stream_index end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
19 20 21 |
# File 'lib/rtsp/request.rb', line 19 def url @url end |