Coder Social home page Coder Social logo

mupnp's People

Contributors

mellon85 avatar ntalbott avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

mupnp's Issues

Exceptions are not being rescued

I am seeing some strange behaviour, I have taken the code from one of the examples with a few extra puts statements:

require 'rubygems'
require 'UPnP'

puts "Before UPnP"

begin
    u = UPnP::UPnP.new
    puts "Internet IP #{u.externalIP}"
    puts "Router Lan IP #{u.routerIP}"
    dn,up = u.maxLinkBitrates()
    puts "Max Link Bitrate #{dn}/#{up}"
    s,e,ut = u.status
    puts "Status #{s}"
    puts "Uptime #{ut}"
    puts "Connection type #{u.connectionType}"
rescue
    puts "Exception Rescued"
end

puts "After Exception"

sleep 60

puts "After Sleep

When I run it I see:

$ bundle exec ruby test.rb
Before UPnP
#<Thread:0x00000000011c5c18@/data/deployer/timeagent/vendor/bundle/ruby/2.5.0/gems/mupnp-0.2.0/lib/UPnP.rb:105 run> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
	1: from /data/deployer/timeagent/vendor/bundle/ruby/2.5.0/gems/mupnp-0.2.0/lib/UPnP.rb:105:in `block in initialize'
/data/deployer/timeagent/vendor/bundle/ruby/2.5.0/gems/mupnp-0.2.0/lib/UPnP.rb:141:in `discoverIGD': No IGD Found (UPnP::UPnPException)
Traceback (most recent call last):
	1: from /data/deployer/timeagent/vendor/bundle/ruby/2.5.0/gems/mupnp-0.2.0/lib/UPnP.rb:105:in `block in initialize'
/data/deployer/timeagent/vendor/bundle/ruby/2.5.0/gems/mupnp-0.2.0/lib/UPnP.rb:141:in `discoverIGD': No IGD Found (UPnP::UPnPException)
$

The exception is not being rescued and the application dies.

I'm using ruby 2.5.3p105.

Any ideas?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.