Class: LightIO::Library::TCPServer
- Includes:
- Base
- Defined in:
- lib/lightio/library/socket.rb
Instance Method Summary collapse
- #accept ⇒ Object
- #accept_nonblock(*args) ⇒ Object
-
#initialize(*args) ⇒ TCPServer
constructor
A new instance of TCPServer.
- #sys_accept ⇒ Object
Methods included from Base
Methods inherited from BasicSocket
Methods included from Module::BasicSocket::ClassMethods
Methods included from Wrap::IOWrapper
Methods inherited from IO
Methods included from Module::IO::ClassMethods
#copy_stream, #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
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 |