[Ruby] DNSSD questions
Evan Phoenix
evan at fallingsnow.net
Fri Jun 6 12:24:23 PDT 2008
On Jun 6, 2008, at 12:19 PM, Alex Vollmer wrote:
> 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)".
Do you control the send site? We had this problem using DNSSD
recently. You HAVE to pass it a TextRecord on the server side, or the
client blows up.
Check out: http://github.com/chad/gitjour/tree/master/lib/gitjour/application.rb#L167
for an example server. Scroll up from that to see the example client.
- Evan
> 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
>
>
>
> _______________________________________________
> Ruby at zenspider.com - Seattle.rb non-commercial list
> http://www.zenspider.com/seattle.rb
> http://www.zenspider.com/mailman/listinfo/ruby
More information about the Ruby
mailing list