Class: Async::IO::SocketEndpoint
- Defined in:
- lib/async/io/endpoint.rb
Overview
This class doesn’t exert ownership over the specified socket, wraps a native ::IO.
Instance Attribute Summary
Attributes inherited from Endpoint
Instance Method Summary collapse
- #address ⇒ Object
- #bind {|Socket.new(specification)| ... } ⇒ Object
- #connect {|Async::IO.try_convert(specification)| ... } ⇒ Object
Methods inherited from Endpoint
#accept, each, #initialize, parse, #socket_domain, #socket_protocol, #socket_type, ssl, tcp, #to_sockaddr, udp, unix
Constructor Details
This class inherits a constructor from Async::IO::Endpoint
Instance Method Details
#address ⇒ Object
140 141 142 |
# File 'lib/async/io/endpoint.rb', line 140 def address specification.local_address end |
#bind {|Socket.new(specification)| ... } ⇒ Object
144 145 146 |
# File 'lib/async/io/endpoint.rb', line 144 def bind(&block) yield Socket.new(specification) end |
#connect {|Async::IO.try_convert(specification)| ... } ⇒ Object
148 149 150 |
# File 'lib/async/io/endpoint.rb', line 148 def connect(&block) yield Async::IO.try_convert(specification) end |