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 included from Peer

#connected?

Methods inherited from BasicSocket

#type

Methods inherited from Generic

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

Instance Method Details

#acceptObject Also known as: sysaccept, accept_nonblock



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

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