Class: EaseEngine::TCPServer

Inherits:
TCPSocket show all
Defined in:
lib/ease_engine/socket.rb

Instance Attribute Summary

Attributes inherited from TCPSocket

#is_heartbeat, #is_timeout

Attributes inherited from Socket

#dst_addr, #err, #is_disable, #read_buf, #read_max_size, #socket, #write_buf

Instance Method Summary collapse

Methods inherited from TCPSocket

#connect, #recv

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

#acceptObject



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