Sha256: 30fa67259af89167b12f8d33cc6cd227700ec7d34e78cdf98b666b26e1e5670d

Contents?: true

Size: 578 Bytes

Versions: 44

Compression:

Stored size: 578 Bytes

Contents

require 'em_test_helper'

class TestIdleConnection < Test::Unit::TestCase
  if EM.respond_to?(:get_idle_time)
    def test_idle_time
      EM.run{
        conn = EM.connect 'www.google.com', 80
        EM.add_timer(3){
          $idle_time = conn.get_idle_time
          conn.send_data "GET / HTTP/1.0\r\n\r\n"
          EM.next_tick{
            $idle_time_after_send = conn.get_idle_time
            conn.close_connection
            EM.stop
          }
        }
      }

      assert_in_delta 3, $idle_time, 0.2
      assert_equal 0, $idle_time_after_send
    end
  end
end

Version data entries

44 entries across 44 versions & 4 rubygems

Version Path
sonixlabs-eventmachine-java-1.0.0.rc.7-java tests/test_idle_connection.rb
eventmachine-1.0.3-x86-mswin32-60 tests/test_idle_connection.rb
eventmachine-1.0.3-x86-mingw32 tests/test_idle_connection.rb
eventmachine-1.0.3-java tests/test_idle_connection.rb
eventmachine-1.0.3 tests/test_idle_connection.rb
eventmachine-1.0.2-java tests/test_idle_connection.rb
eventmachine-1.0.2-x86-mswin32-60 tests/test_idle_connection.rb
eventmachine-1.0.2-x86-mingw32 tests/test_idle_connection.rb
eventmachine-1.0.2 tests/test_idle_connection.rb
eventmachine-1.0.1-x86-mswin32-60 tests/test_idle_connection.rb
eventmachine-1.0.1-x86-mingw32 tests/test_idle_connection.rb
eventmachine-1.0.1-java tests/test_idle_connection.rb
eventmachine-1.0.1 tests/test_idle_connection.rb
eventmachine-maglev--1.0.0 tests/test_idle_connection.rb
sonixlabs-eventmachine-java-1.0.0.rc.5-java tests/test_idle_connection.rb
eventmachine-le-1.1.4 tests/test_idle_connection.rb
eventmachine-le-1.1.4.beta.2 tests/test_idle_connection.rb
sonixlabs-eventmachine-java-1.0.0.rc.4-java tests/test_idle_connection.rb
eventmachine-1.0.0-java tests/test_idle_connection.rb
eventmachine-1.0.0-x86-mingw32 tests/test_idle_connection.rb