Class: Async::IO::AddressEndpoint
- Defined in:
- lib/async/io/endpoint.rb
Overview
This class will open and close the socket automatically.
Instance Attribute Summary collapse
-
#address ⇒ Object
readonly
Returns the value of attribute address.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #bind(&block) ⇒ Object
- #connect(&block) ⇒ Object
-
#initialize(address, **options) ⇒ AddressEndpoint
constructor
A new instance of AddressEndpoint.
Methods inherited from Endpoint
#accept, #each, each, parse, ssl, tcp, try_convert, udp, unix
Constructor Details
#initialize(address, **options) ⇒ AddressEndpoint
Returns a new instance of AddressEndpoint.
132 133 134 135 |
# File 'lib/async/io/endpoint.rb', line 132 def initialize(address, **) @address = address = end |
Instance Attribute Details
#address ⇒ Object (readonly)
Returns the value of attribute address.
137 138 139 |
# File 'lib/async/io/endpoint.rb', line 137 def address @address end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
138 139 140 |
# File 'lib/async/io/endpoint.rb', line 138 def end |
Instance Method Details
#bind(&block) ⇒ Object
140 141 142 |
# File 'lib/async/io/endpoint.rb', line 140 def bind(&block) Socket.bind(@address, **, &block) end |
#connect(&block) ⇒ Object
144 145 146 |
# File 'lib/async/io/endpoint.rb', line 144 def connect(&block) Socket.connect(@address, **, &block) end |