|
Post by iamjkdn on Jan 6, 2018 16:19:58 GMT
Hey Can someone provide an example of how to use socket library with UDP provided with standard Rhodes framework? --- I am using this SSDP gemIt depends on ` ipaddr`, `socket` I have added `ipaddr` to the main Rhodes gem framework. I modified the ssdp gem and included the contents inside its lib folder to the main framework as well. Upon compilation of the app, it shows no error. Neither the adb log shows any error. But there is no output. Wonder if the gem functionality is not supported or there is some system error? The SSDP gem creates a UDP socket to listen to Upnp devices on a network. I am trying to build a Upnp control point. 1. It requires access to native HTTP services, like sending requests over TCP/IP and UDP. 2. It also needs to serve music files from the phone over network. 3. It would also need to handle custom HTTP methods apart from GET/POST, like NOTIFY and SUBSCRIBE As of now I am attempting task 1 and I dont see any errors in the adb. This is the adb log - paste.ubuntu.com/26328082/In application.rb require 'socket' require 'ipaddr' require 'ssdp' In index.erb <%= finder = SSDP::Consumer.new :timeout => 3 %> <br /> <%= result = finder.search :service => 'ssdp:all' %> <br /> <%= IPAddr.new('239.255.255.250').hton + IPAddr.new('0.0.0.0').hton %> <br /> <%= Rho::Network.hasNetwork %> <br /> <%= result %> The above code returns nothing in the Rhodes app. Except IPAddr, which returns gibberish symbols. Only that works.
|
|
|
Post by jontara on Jan 9, 2018 8:32:00 GMT
|
|