Class: LightIO::Library::TCPServer
Instance Method Summary
collapse
Methods included from Base
included
Methods inherited from BasicSocket
#shutdown
#for_fd
included
Methods inherited from IO
#to_io
#open, #pipe, #select
#close, #eof, #getbyte, #getc, #gets, included, #print, #printf, #puts, #read, #readbyte, #readchar, #readline, #readlines, #readpartial, #wait, #wait_readable, #wait_writable
Constructor Details
#initialize(*args) ⇒ TCPServer
Returns a new instance of TCPServer.
168
169
170
|
# File 'lib/lightio/library/socket.rb', line 168
def initialize(*args)
@obj = ::TCPServer.send(:origin_new, *args)
end
|
Instance Method Details
#accept ⇒ Object
172
173
174
175
|
# File 'lib/lightio/library/socket.rb', line 172
def accept
socket = wait_nonblock(:accept_nonblock)
TCPSocket._wrap(socket)
end
|
#accept_nonblock(*args) ⇒ Object
177
178
179
180
|
# File 'lib/lightio/library/socket.rb', line 177
def accept_nonblock(*args)
socket = @obj.accept_nonblock(*args)
socket.is_a?(Symbol) ? socket : TCPSocket._wrap(socket)
end
|
#sys_accept ⇒ Object
182
183
184
185
|
# File 'lib/lightio/library/socket.rb', line 182
def sys_accept
io_watcher.wait_readable
@obj.sys_accept
end
|