Class: Async::IO::SocketEndpoint

Inherits:
Endpoint
  • Object
show all
Defined in:
lib/async/io/endpoint.rb

Overview

This class doesn’t exert ownership over the specified socket.

Instance Attribute Summary

Attributes inherited from Endpoint

#options, #specification

Instance Method Summary collapse

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

#addressObject



132
133
134
# File 'lib/async/io/endpoint.rb', line 132

def address
	specification.local_address
end

#bind {|Socket.new(specification, **options)| ... } ⇒ Object

Yields:



136
137
138
# File 'lib/async/io/endpoint.rb', line 136

def bind(&block)
	yield Socket.new(specification, **options)
end

#connect {|Async::IO.try_convert(specification)| ... } ⇒ Object



140
141
142
# File 'lib/async/io/endpoint.rb', line 140

def connect(&block)
	yield Async::IO.try_convert(specification)
end