Class: Falcon::Listener
- Inherits:
-
Object
- Object
- Falcon::Listener
- Defined in:
- lib/falcon/listener.rb
Overview
Describes a bound listener for a Falcon server.
Instance Attribute Summary collapse
-
#addresses ⇒ Object
readonly
Returns the value of attribute addresses.
-
#endpoint ⇒ Object
readonly
Returns the value of attribute endpoint.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#protocols ⇒ Object
readonly
Returns the value of attribute protocols.
-
#scheme ⇒ Object
readonly
Returns the value of attribute scheme.
- #The application protocol scheme.(applicationprotocolscheme.) ⇒ Object readonly
- #The bound addresses.(boundaddresses.) ⇒ Object readonly
- #The logical listener name.(logicallistenername.) ⇒ Object readonly
- #The supported application protocol names.(supportedapplicationprotocolnames.) ⇒ Object readonly
Instance Method Summary collapse
-
#close ⇒ Object
Close the bound endpoint.
-
#initialize(name:, scheme:, protocols:, endpoint:) ⇒ Listener
constructor
Initialize a bound listener.
- #The bound endpoint.=(boundendpoint. = (value)) ⇒ Object
Constructor Details
#initialize(name:, scheme:, protocols:, endpoint:) ⇒ Listener
Initialize a bound listener.
14 15 16 17 18 19 20 21 |
# File 'lib/falcon/listener.rb', line 14 def initialize(name:, scheme:, protocols:, endpoint:) @name = name @scheme = scheme @protocols = protocols.map(&:to_s).freeze @endpoint = endpoint @addresses = endpoint.sockets.map{|socket| socket.to_io.local_address}.freeze freeze end |
Instance Attribute Details
#addresses ⇒ Object (readonly)
Returns the value of attribute addresses.
36 37 38 |
# File 'lib/falcon/listener.rb', line 36 def addresses @addresses end |
#endpoint ⇒ Object (readonly)
Returns the value of attribute endpoint.
33 34 35 |
# File 'lib/falcon/listener.rb', line 33 def endpoint @endpoint end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
24 25 26 |
# File 'lib/falcon/listener.rb', line 24 def name @name end |
#protocols ⇒ Object (readonly)
Returns the value of attribute protocols.
30 31 32 |
# File 'lib/falcon/listener.rb', line 30 def protocols @protocols end |
#scheme ⇒ Object (readonly)
Returns the value of attribute scheme.
27 28 29 |
# File 'lib/falcon/listener.rb', line 27 def scheme @scheme end |
#The application protocol scheme.(applicationprotocolscheme.) ⇒ Object (readonly)
27 |
# File 'lib/falcon/listener.rb', line 27 attr_reader :scheme |
#The bound addresses.(boundaddresses.) ⇒ Object (readonly)
36 |
# File 'lib/falcon/listener.rb', line 36 attr_reader :addresses |
#The logical listener name.(logicallistenername.) ⇒ Object (readonly)
24 |
# File 'lib/falcon/listener.rb', line 24 attr_reader :name |
#The supported application protocol names.(supportedapplicationprotocolnames.) ⇒ Object (readonly)
30 |
# File 'lib/falcon/listener.rb', line 30 attr_reader :protocols |
Instance Method Details
#close ⇒ Object
Close the bound endpoint.
39 40 41 |
# File 'lib/falcon/listener.rb', line 39 def close @endpoint.close end |
#The bound endpoint.=(boundendpoint. = (value)) ⇒ Object
33 |
# File 'lib/falcon/listener.rb', line 33 attr_reader :endpoint |