kgio.git  about / heads / tags
kinder, gentler I/O for Ruby
blob b1326f36b47e4f7f8430385176a5f5c2e1e7dc68 383 bytes (raw)
$ git show HEAD:test/test_connect_fd_leak.rb	# shows this blob on the CLI

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
 
require 'test/unit'
require 'io/nonblock'
$-w = true
require 'kgio'

class TestConnectFDLeak < Test::Unit::TestCase

  def test_unix_socket
    nr = 0
    path = "/non/existent/path"
    assert(! File.exist?(path), "#{path} should not exist")
    begin
      sock = Kgio::UNIXSocket.new(path)
    rescue Errno::ENOENT
    end while (nr += 1) < 10000
    sock.close if sock
  end
end

git clone git://yhbt.net/kgio.git
git clone https://yhbt.net/kgio.git