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 Method Summary collapse

Methods inherited from BasicSocket

#type

Methods inherited from Generic

#nonblock, #nonblock?, #read, #wait, wrap, wrap_blocking_method, wraps, #write

Instance Method Details

#acceptObject Also known as: sysaccept, accept_nonblock



33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/async/io/unix_socket.rb', line 33

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