Sha256: e055ddbb7b5873ae268a3502283065b10c3a402010efac96f1b9e2af2b6b2c3c

Contents?: true

Size: 601 Bytes

Versions: 27

Compression:

Stored size: 601 Bytes

Contents

require 'test/unit'
$-w = true
require 'kgio'

class TestCrossThreadClose < Test::Unit::TestCase

  def test_cross_thread_close
    host = ENV["TEST_HOST"] || '127.0.0.1'
    srv = Kgio::TCPServer.new(host, 0)
    thr = Thread.new do
      begin
        srv.kgio_accept
      rescue => e
        e
      end
    end
    sleep(0.1) until thr.stop?
    srv.close
    unless defined?(RUBY_ENGINE) && RUBY_ENGINE == "ruby" &&
           RUBY_VERSION == "1.9.3"
      thr.run rescue nil
    end
    thr.join
    assert_kind_of IOError, thr.value
  end
end if defined?(RUBY_ENGINE) && RUBY_ENGINE == "ruby"

Version data entries

27 entries across 27 versions & 2 rubygems

Version Path
kgio-2.11.4 test/test_cross_thread_close.rb
kgio-2.11.3 test/test_cross_thread_close.rb
kgio-2.11.2 test/test_cross_thread_close.rb
kgio-2.11.1.1.g36ea test/test_cross_thread_close.rb
kgio-2.11.1 test/test_cross_thread_close.rb
kgio-2.11.0 test/test_cross_thread_close.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/kgio-2.10.0/test/test_cross_thread_close.rb
kgio-2.10.0 test/test_cross_thread_close.rb
kgio-2.9.3 test/test_cross_thread_close.rb
kgio-2.9.2 test/test_cross_thread_close.rb
kgio-2.9.1 test/test_cross_thread_close.rb
kgio-2.9.0.2.gf33a test/test_cross_thread_close.rb
kgio-2.9.0 test/test_cross_thread_close.rb
kgio-2.8.1 test/test_cross_thread_close.rb
kgio-2.8.0.2.g30c1 test/test_cross_thread_close.rb
kgio-2.8.0 test/test_cross_thread_close.rb
kgio-2.7.4 test/test_cross_thread_close.rb
kgio-2.7.3 test/test_cross_thread_close.rb
kgio-2.7.2 test/test_cross_thread_close.rb
kgio-2.7.1 test/test_cross_thread_close.rb