mirror of
https://github.com/puma/puma.git
synced 2022-11-09 13:48:40 -05:00
Remove bonjour experiment
This commit is contained in:
parent
6a107fdd76
commit
ea72a93e1c
2 changed files with 0 additions and 40 deletions
|
@ -172,10 +172,6 @@ module Puma
|
|||
end
|
||||
end
|
||||
|
||||
if server.attempt_bonjour(@rackup)
|
||||
log "* Announced services via bonjour"
|
||||
end
|
||||
|
||||
log "Use Ctrl-C to stop"
|
||||
|
||||
begin
|
||||
|
|
|
@ -500,41 +500,5 @@ module Puma
|
|||
|
||||
@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
|
||||
|
|
Loading…
Reference in a new issue