DNS-SD Gem (0.6.0) on OSX Leopard 10.5.3

Discussion in 'Ruby' started by Don Levan, Jun 18, 2008.

  1. Don Levan

    Don Levan Guest

    [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"


    (917) 842-2911
     
    Don Levan, Jun 18, 2008
    #1
    1. Advertising

  2. Don Levan

    Don Levan Guest

    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"
    >
    >
    > (917) 842-2911
     
    Don Levan, Jun 18, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Imok20

    GCC Broken on Leopard (OSX)

    Imok20, Jan 19, 2008, in forum: C Programming
    Replies:
    11
    Views:
    487
    CBFalconer
    Jan 21, 2008
  2. Replies:
    3
    Views:
    2,175
  3. john skaller

    linking on OSX Snow Leopard

    john skaller, Oct 24, 2010, in forum: Python
    Replies:
    0
    Views:
    218
    john skaller
    Oct 24, 2010
  4. Tim Becker

    Ruby DTrace (on OSX Leopard)

    Tim Becker, Oct 30, 2007, in forum: Ruby
    Replies:
    1
    Views:
    100
    Tim Becker
    Oct 30, 2007
  5. Matthias Tarasiewicz
    Replies:
    4
    Views:
    221
    Matthias Tarasiewicz
    Feb 2, 2009
Loading...

Share This Page