easy_upnp icon indicating copy to clipboard operation
easy_upnp copied to clipboard

".host" method sometimes puts out error

Open yamatakau08 opened this issue 8 years ago • 2 comments

Dear Chris@sidoh san,

I run the follwoing script

#! /bin/ruby

require 'easy_upnp'

searcher = EasyUpnp::SsdpSearcher.new 
devices = searcher.search 'ssdp:all'

device = devices.first

p device
puts "host:#{device.host}"

sometimes puts out error like this.

yama@tnt:~/bin/UPnP$ ./easy_upnp.rb
#<EasyUpnp::UpnpDevice:0x00000600d3cd80 @uuid="uuid:bf5d857e-6195-4cc2-ab75-f19f7dec2e79", @service_definitions=[]>
/cygdrive/c/yama/.gem/ruby/gems/easy_upnp-1.1.9/lib/easy_upnp/upnp_device.rb:37:in `host': undefined method `[]' for nil:NilClass (NoMethodError)
        from ./easy_upnp.rb:12:in `<main>'

yamatakau08 avatar Jul 01 '16 09:07 yamatakau08

It looks like you have a device on your network responding to search requests without having any service endpoints.

I'd like to add some verbose logging options to the SSDP search. I'll let you know when I do that (should have time in the next few days). Would you be able to paste some output for me when I get to that?

sidoh avatar Jul 03 '16 05:07 sidoh

Thank you for your support!

I'll let you know when I do that (should have time in the next few days). I'm waiting for your modification Would you be able to paste some output for me when I get to that? Of course. No problem.

yamatakau08 avatar Jul 03 '16 08:07 yamatakau08