Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
eventmachine / tests / test_many_fds.rb
Size: Mime:
require 'em_test_helper'
require 'socket'

class TestManyFDs < Test::Unit::TestCase
  def setup
    @port = next_port
  end

  def test_connection_class_cache
    mod = Module.new
    a = nil
    Process.setrlimit(Process::RLIMIT_NOFILE, 4096) rescue nil
    EM.run {
      EM.start_server '127.0.0.1', @port, mod
      1100.times do
        a = EM.connect '127.0.0.1', @port, mod
        assert_kind_of EM::Connection, a
      end
      EM.stop
    }
  end
end