From 6fbde1518578dd1b828efcecaf2caf893bddc110 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 27 Sep 2010 00:11:43 +0000 Subject: "start" singleton methods for non-blocking connect These initiate (but do not wait for) non-blocking connects. --- test/test_unix_connect.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'test/test_unix_connect.rb') diff --git a/test/test_unix_connect.rb b/test/test_unix_connect.rb index 458149d..4b7519c 100644 --- a/test/test_unix_connect.rb +++ b/test/test_unix_connect.rb @@ -48,6 +48,23 @@ class TestKgioUnixConnect < Test::Unit::TestCase assert_equal nil, sock.kgio_write("HELLO") end + def test_start + sock = Kgio::Socket.start(@addr) + assert_instance_of Kgio::Socket, sock + ready = IO.select(nil, [ sock ]) + assert_equal sock, ready[1][0] + assert_equal nil, sock.kgio_write("HELLO") + end + + def test_socket_start + Kgio::wait_writable = :wait_writable + sock = SubSocket.start(@addr) + assert_nil sock.foo + ready = IO.select(nil, [ sock ]) + assert_equal sock, ready[1][0] + assert_equal nil, sock.kgio_write("HELLO") + end + def test_wait_writable_set Kgio::wait_writable = :wait_writable sock = SubSocket.new(@addr) -- cgit v1.2.3-24-ge0c7