File: test_many_fds.rb

package info (click to toggle)
ruby-eventmachine 1.0.3-6%2Bdeb8u1
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 2,000 kB
  • ctags: 3,178
  • sloc: ruby: 8,641; cpp: 5,217; java: 827; makefile: 5
file content (22 lines) | stat: -rw-r--r-- 451 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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);
    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