Class: LightIO::Library::UNIXServer

Inherits:
UNIXSocket show all
Includes:
Base
Defined in:
lib/lightio/library/socket.rb

Instance Method Summary collapse

Methods included from Base

included, #initialize

Methods inherited from UNIXSocket

#recv_io, #send_io

Methods inherited from BasicSocket

#shutdown

Methods included from Module::BasicSocket::ClassMethods

#for_fd

Methods included from Wrap::IOWrapper

included, #initialize

Methods inherited from IO

#to_io

Methods included from Module::IO::ClassMethods

#open, #pipe, #select

Methods included from IO::IOMethods

#close, #eof, #getbyte, #getc, #gets, included, #print, #printf, #puts, #read, #readbyte, #readchar, #readline, #readlines, #readpartial, #wait, #wait_readable, #wait_writable

Instance Method Details

#acceptObject



222
223
224
225
# File 'lib/lightio/library/socket.rb', line 222

def accept
  socket = wait_nonblock(:accept_nonblock)
  UNIXSocket._wrap(socket)
end

#accept_nonblock(*args) ⇒ Object



227
228
229
230
# File 'lib/lightio/library/socket.rb', line 227

def accept_nonblock(*args)
  socket = @obj.accept_nonblock(*args)
  socket.is_a?(Symbol) ? socket : UNIXSocket._wrap(socket)
end

#sys_acceptObject



217
218
219
220
# File 'lib/lightio/library/socket.rb', line 217

def sys_accept
  io_watcher.wait_readable
  @obj.sys_accpet
end