Skip to content

Commit

Permalink
Remove bonjour experiment
Browse files Browse the repository at this point in the history
  • Loading branch information
evanphx committed Dec 3, 2011
1 parent 6a107fd commit ea72a93
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 40 deletions.
4 changes: 0 additions & 4 deletions lib/puma/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,6 @@ def run
end
end

if server.attempt_bonjour(@rackup)
log "* Announced services via bonjour"
end

log "Use Ctrl-C to stop"

begin
Expand Down
36 changes: 0 additions & 36 deletions lib/puma/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -500,41 +500,5 @@ def stop(sync=false)

@thread.join if @thread && sync
end

# If the dnssd gem is installed, advertise any TCPServer's configured
# out via bonjour.
#
# +name+ is the host name to use when advertised.
#
def attempt_bonjour(name)
begin
require 'dnssd'
rescue LoadError
return false
end

@bonjour_registered = false
announced = false

@ios.each do |io|
if io.kind_of? TCPServer
fixed_name = name.gsub(/\./, "-")

DNSSD.announce io, "puma - #{fixed_name}", "http" do |r|
@bonjour_registered = true
end

announced = true
end
end

return announced
end

# Indicate if attempt_bonjour worked.
#
def bonjour_registered?
@bonjour_registered ||= false
end
end
end

0 comments on commit ea72a93

Please sign in to comment.