Class: Puppet::Network::Server Private
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #address ⇒ Object readonly private
- #port ⇒ Object readonly private
Instance Method Summary collapse
-
#initialize(address, port) ⇒ Server
constructor
private
A new instance of Server.
- #listening? ⇒ Boolean private
- #start ⇒ Object private
- #stop ⇒ Object private
- #wait_for_shutdown ⇒ Object private
Constructor Details
#initialize(address, port) ⇒ Server
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Server.
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/puppet/network/server.rb', line 9 def initialize(address, port) @port = port @address = address @http_server = Puppet::Network::HTTP::WEBrick.new @listening = false # Make sure we have all of the directories we need to function. Puppet.settings.use(:main, :ssl, :application) end |
Instance Attribute Details
#address ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
7 8 9 |
# File 'lib/puppet/network/server.rb', line 7 def address @address end |
#port ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
7 8 9 |
# File 'lib/puppet/network/server.rb', line 7 def port @port end |
Instance Method Details
#listening? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
20 21 22 |
# File 'lib/puppet/network/server.rb', line 20 def listening? @listening end |
#start ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
24 25 26 27 28 |
# File 'lib/puppet/network/server.rb', line 24 def start raise _("Cannot listen -- already listening.") if listening? @listening = true @http_server.listen(address, port) end |
#stop ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
30 31 32 33 34 |
# File 'lib/puppet/network/server.rb', line 30 def stop raise _("Cannot unlisten -- not currently listening.") unless listening? @http_server.unlisten @listening = false end |
#wait_for_shutdown ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
36 37 38 |
# File 'lib/puppet/network/server.rb', line 36 def wait_for_shutdown @http_server.wait_for_shutdown end |