mrblib/mrb_simplehttpserver.rb
def run
    srv = if self.path
            UNIXServer.new(path)
          else
            TCPServer.new(host, port)
          end

    loop do
      io = accept_connection(srv)

      begin
        data = receive_data(io)
        send_data(io, handle_data(io, data)) if data
      rescue
        raise 'Connection reset by peer' if config[:debug] && io.closed?
      ensure
        io.close rescue nil
        GC.start if config[:run_gc_per_request]
      end
    end
  end
# Bind to the host and port and wait for incomming connections.
#
# @return [ Void ]
Bind to the host and port and wait for incomming connections.
Bind to the host and port and wait for incomming connections .
def run
    srv = if self.path
            UNIXServer.new(path)
          else
            TCPServer.new(host, port)
          end
    loop do
      io = accept_connection(srv)
      begin
        data = receive_data(io)
        send_data(io, handle_data(io, data)) if data
      rescue
        raise 'Connection reset by peer' if config[:debug] && io.closed?
      ensure
        io.close rescue nil
        GC.start if config[:run_gc_per_request]
      end
    end
  end
def run srv = if self . path UNIXServer . new ( path ) else TCPServer . new ( host , port ) end loop do io = accept_connection ( srv ) begin data = receive_data ( io ) send_data ( io , handle_data ( io , data ) ) if data rescue raise 'Connection reset by peer' if config [ :debug ] && io . closed? ensure io . close rescue nil GC . start if config [ :run_gc_per_request ] end end end
Bind to the host and port and wait for incomming connections.
Bind to the host and port and wait for incomming connections .
None
 Void 