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, wraps a native ::IO.

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



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

def address
	specification.local_address
end

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

Yields:



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