[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

DNS-SD Gem (0.6.0) on OSX Leopard 10.5.3

Don Levan

6/18/2008 12:42:00 PM

[Note: parts of this message were removed to make it a legal post.]

Hi All,

I am attempting to use the DNS-SD gem to return information about
bonjour on Leopard. When I use the command line tool with the command
"$ dns-sd -B _sftp-ssh._tcp" I get the following response:

Browsing for _sftp-ssh._tcp
Timestamp A/R Flags if Domain Service
Type Instance Name
8:34:04.871 Add 3 5 local. _sftp-
ssh._tcp. DL Office Desktop
8:34:04.872 Add 3 9 local. _sftp-
ssh._tcp. DL Office Desktop
8:34:04.872 Add 3 10 local. _sftp-
ssh._tcp. DL Office Desktop
8:34:04.872 Add 3 7 local. _sftp-
ssh._tcp. DL Office Desktop
8:34:04.872 Add 2 8 local. _sftp-
ssh._tcp. DL Office Desktop


However, when I run the following I get no response back:

#!/usr/bin/env ruby -wKU


require 'rubygems'
require 'dnssd'

DNSSD.browse("_sftp-ss._tcp") do |browse_reply|
puts browse_reply
end

I am using ruby 1.8.6 on Leopard 10.5.3 with dnssd-0.6.0 (ruby and the
gem were part of the standard Leopard install). My ultimate goal will
be to browse for DNSSD services and then resolve a particular service.

Thank you in advance for any help you might be able to render.

Don Levan, Psy. D.
President, Vanguard Custom Software
"We create simple applications which solve complex problems"

don@vanguardcs.net
(917) 842-2911
1 Answer

Don Levan

6/18/2008 3:21:00 PM

0

Hi All,

I was in error in my last email. In fact, DNSSD.browse is returning
the result as expect. instead, DNSSD.resolve is not returning any
response when the [ dns-sd -L "Denis's MacBook Air" _ssh._tcp local ]
command line tool returns the response as expected.

Here is the commandline response:
_____
Don-Levan-x-392:~ donl$ dns-sd -L "Denis's MacBook Air" _ssh._tcp local
Lookup Denis's MacBook Air._ssh._tcp.local
11:04:13.345 Denis's\032MacBook\032Air._ssh._tcp.local. can be
reached at Deniss-MacBook-Air.local.:22

Here is what my script looks like:
________

#!/usr/bin/env ruby -wKU

require 'rubygems'
require 'dnssd'



class DNSResolver

def resolve
puts "resolving"

resolver = DNSSD.resolve("Denis's MacBook Air", "_ssh._tcp",
"local") do |resolve_reply|
puts "Resolve Result: #{resolve_reply.inspect}"
end

puts "Resolver Started"
sleep 30
resolver.stop
puts "Resolver Stopped"

end

end

resolve_reply = DNSResolver.new.resolve
_____

This is the response from I get in textmate:
_________

RubyMate r8136 running Ruby r1.8.6 (/System/Library/Frameworks/
Ruby.framework/Versions/1.8/usr/bin/ruby) >>> dnssdbrowse.rb
resolving
Resolver Started
Resolver Stopped
Program exited.




Thanks again for any help.

Don Levan





On Jun 18, 2008, at 8:42 AM, Don Levan wrote:

> Hi All,
>
> I am attempting to use the DNS-SD gem to return information about
> bonjour on Leopard. When I use the command line tool with the
> command "$ dns-sd -B _sftp-ssh._tcp" I get the following response:
>
> Browsing for _sftp-ssh._tcp
> Timestamp A/R Flags if Domain Service
> Type Instance Name
> 8:34:04.871 Add 3 5 local. _sftp-
> ssh._tcp. DL Office Desktop
> 8:34:04.872 Add 3 9 local. _sftp-
> ssh._tcp. DL Office Desktop
> 8:34:04.872 Add 3 10 local. _sftp-
> ssh._tcp. DL Office Desktop
> 8:34:04.872 Add 3 7 local. _sftp-
> ssh._tcp. DL Office Desktop
> 8:34:04.872 Add 2 8 local. _sftp-
> ssh._tcp. DL Office Desktop
>
>
> However, when I run the following I get no response back:
>
> #!/usr/bin/env ruby -wKU
>
>
> require 'rubygems'
> require 'dnssd'
>
> DNSSD.browse("_sftp-ss._tcp") do |browse_reply|
> puts browse_reply
> end
>
> I am using ruby 1.8.6 on Leopard 10.5.3 with dnssd-0.6.0 (ruby and
> the gem were part of the standard Leopard install). My ultimate goal
> will be to browse for DNSSD services and then resolve a particular
> service.
>
> Thank you in advance for any help you might be able to render.
>
> Don Levan, Psy. D.
> President, Vanguard Custom Software
> "We create simple applications which solve complex problems"
>
> don@vanguardcs.net
> (917) 842-2911