Class: Async::IO::UNIXServer

Inherits:
UNIXSocket show all
Defined in:
lib/async/io/unix_socket.rb

Constant Summary

Constants inherited from Generic

Generic::WRAPPERS

Instance Attribute Summary

Attributes inherited from Generic

#timeout

Instance Method Summary collapse

Methods included from Peer

#connected?, #eof, #eof?, #protocol, #sync, #sync=, #type

Methods inherited from Generic

#<<, #connected?, #dup, #nonblock, #nonblock=, #nonblock?, #read, #sysread, #syswrite, #wait, wrap, wrap_blocking_method, wraps, #write

Instance Method Details

#acceptObject Also known as: sysaccept, accept_nonblock


37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/async/io/unix_socket.rb', line 37

def accept
	peer = async_send(:accept_nonblock)
	wrapper = UNIXSocket.new(peer, self.reactor)
	
	return wrapper unless block_given?
	
	begin
		yield wrapper
	ensure
		wrapper.close
	end
end