[Ruby] DNSSD questions
Alex Vollmer
alex.vollmer at gmail.com
Fri Jun 6 12:19:25 PDT 2008
Any of you smart fellers out there worked with DNSSD? I'm trying to
run a simple discovery thread and, at work, the loop exits with an
ArgumentError and the message "buffer contains invalid text record
(ArgumentError)". After trolling the mailing list it appears that it's
the result of some wonky DNS record somebody is returning. So clearly
I want to guard against this, but no amount of begin/rescue is
preventing this from exiting. The code looks kinda like:
DNSSD.browse("_http._tcp") do |reply|
begin
DNSSD.resolve reply.name, reply.type, reply.domain do |
resolve_reply|
# do stuff here
# ...
end
rescue ArgumentError
# usually a jacked DNS text record
end
end
I also tried moving the begin/rescue block into the call to
DNSSD.resolve, but to no avail. Any ideas or suggestions? Am I missing
something painfully obvious (likely)?
TIA,
Alex V.
----
Musings & Notes
http://blog.livollmers.net
More information about the Ruby
mailing list