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
#binmode, #lineno, #lineno=, #rewind, #seek, #set_encoding, #to_io
Methods included from Module::IO::ClassMethods
#copy_stream, #open, #pipe, #select
Methods included from IO::IOMethods
#close, #eof, #flush, #getbyte, #getc, #gets, #lightio_initialize, #print, #printf, #puts, #read, #readbyte, #readchar, #readline, #readlines, #readpartial, #wait, #wait_readable, #wait_writable, #write
Constructor Details
#initialize(*args) ⇒ TCPServer
Returns a new instance of TCPServer.
169 170 171 172 |
# File 'lib/lightio/library/socket.rb', line 169 def initialize(*args) @obj = ::TCPServer.send(:origin_new, *args) lightio_initialize end |
Instance Method Details
#accept ⇒ Object
174 175 176 177 |
# File 'lib/lightio/library/socket.rb', line 174 def accept socket = wait_nonblock(:accept_nonblock) TCPSocket._wrap(socket) end |
#accept_nonblock(*args) ⇒ Object
179 180 181 182 |
# File 'lib/lightio/library/socket.rb', line 179 def accept_nonblock(*args) socket = @obj.accept_nonblock(*args) socket.is_a?(Symbol) ? socket : TCPSocket._wrap(socket) end |
#sys_accept ⇒ Object
184 185 186 187 |
# File 'lib/lightio/library/socket.rb', line 184 def sys_accept io_watcher.wait_readable @obj.sys_accept end |