Class: EaseEngine::TCPServer
- Defined in:
- lib/ease_engine/socket.rb
Instance Attribute Summary
Attributes inherited from TCPSocket
Attributes inherited from Socket
#dst_addr, #err, #is_disable, #read_buf, #read_max_size, #socket, #write_buf
Instance Method Summary collapse
- #accept ⇒ Object
-
#initialize(host, port) ⇒ TCPServer
constructor
A new instance of TCPServer.
- #listen(backlog = Socket::Constants::SOMAXCONN) ⇒ Object
Methods inherited from TCPSocket
Methods inherited from Socket
#bind, #close, #errno, #recv, #recvfrom, #send, #to_i
Constructor Details
#initialize(host, port) ⇒ TCPServer
Returns a new instance of TCPServer.
135 136 137 |
# File 'lib/ease_engine/socket.rb', line 135 def initialize( host, port ) super( ::TCPServer.new( host, port ) ) end |
Instance Method Details
#accept ⇒ Object
143 144 145 146 147 148 149 150 151 |
# File 'lib/ease_engine/socket.rb', line 143 def accept @err = nil begin EaseEngine::TCPSocket.new( @socket.accept ) rescue => err @err = err nil end end |
#listen(backlog = Socket::Constants::SOMAXCONN) ⇒ Object
139 140 141 |
# File 'lib/ease_engine/socket.rb', line 139 def listen( backlog = Socket::Constants::SOMAXCONN ) @socket.listen( backlog ) end |