Class: RUPNP::SSDP::Notifier
- Inherits:
-
MulticastConnection
- Object
- EM::Connection
- MulticastConnection
- RUPNP::SSDP::Notifier
- Includes:
- HTTP
- Defined in:
- lib/rupnp/ssdp/notifier.rb
Overview
Searcher class for searching devices
Constant Summary collapse
- DEFAULT_NOTIFY_TRY =
Number of SEARCH datagrams to send
2
Constants included from LogMixin
Instance Method Summary collapse
-
#initialize(type, subtype, options = {}) ⇒ Notifier
constructor
A new instance of Notifier.
- #post_init ⇒ Object
- #receive_data(data) ⇒ Object
Methods included from HTTP
#get_http_headers, #get_http_verb, #is_http_status_ok?
Methods inherited from MulticastConnection
Methods included from LogMixin
Constructor Details
#initialize(type, subtype, options = {}) ⇒ Notifier
Returns a new instance of Notifier.
16 17 18 19 20 21 22 23 |
# File 'lib/rupnp/ssdp/notifier.rb', line 16 def initialize(type, subtype, ={}) @type = (type == :root) ? 'upnp:rootdevice' : type @subtype = subtype @notify_count = [:try_number] || DEFAULT_NOTIFY_TRY @options = super .delete(:ttl) end |
Instance Method Details
#post_init ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'lib/rupnp/ssdp/notifier.rb', line 26 def post_init notify = notify_request @notify_count.times do send_datagram notify, MULTICAST_IP, DISCOVERY_PORT log :debug, "#{self.class}: send datagram:\n#{notify}" end close_connection_after_writing end |
#receive_data(data) ⇒ Object
36 37 |
# File 'lib/rupnp/ssdp/notifier.rb', line 36 def receive_data(data) end |