diff options
author | Eric Wong <normalperson@yhbt.net> | 2013-01-18 10:50:28 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2013-01-18 10:50:28 +0000 |
commit | 3e555a62c75406d15199fd7bdb287704e5738352 (patch) | |
tree | 14e6a5b4f3e629fb74ae9cd00f72005cb59b4857 /test | |
parent | c751f42f5f6a5e54a399df472015ab6d2ffc3f7a (diff) | |
download | kgio-3e555a62c75406d15199fd7bdb287704e5738352.tar.gz |
rename fastopen => kgio_fastopen in Kgio::Socket
In the unlikely case the Ruby Socket class implements its own "fastopen" method, we will avoid conflicting.
Diffstat (limited to 'test')
-rw-r--r-- | test/test_tfo.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/test_tfo.rb b/test/test_tfo.rb index 846e273..5ab208d 100644 --- a/test/test_tfo.rb +++ b/test/test_tfo.rb @@ -33,7 +33,7 @@ class TestTFO < Test::Unit::TestCase port = s.local_address.ip_port addr = Socket.pack_sockaddr_in(port, addr) c = Kgio::Socket.new(:INET, :STREAM) - assert_nil c.fastopen("HELLO", addr) + assert_nil c.kgio_fastopen("HELLO", addr) a = s.accept assert_equal "HELLO", a.read(5) c.close @@ -41,7 +41,7 @@ class TestTFO < Test::Unit::TestCase # ensure empty sends work c = Kgio::Socket.new(:INET, :STREAM) - assert_nil c.fastopen("", addr) + assert_nil c.kgio_fastopen("", addr) a = s.accept Thread.new { c.close } assert_nil a.read(1) @@ -56,14 +56,14 @@ class TestTFO < Test::Unit::TestCase assert_equal buf.size, a.read(buf.size).size a.close end - assert_nil c.fastopen(buf, addr) + assert_nil c.kgio_fastopen(buf, addr) thr.join c.close # allow timeouts c = Kgio::Socket.new(:INET, :STREAM) c.setsockopt(:SOCKET, :SNDTIMEO, [ 0, 10 ].pack("l_l_")) - unsent = c.fastopen(buf, addr) + unsent = c.kgio_fastopen(buf, addr) c.close assert_equal s.accept.read.size + unsent.size, buf.size end if defined?(Addrinfo) && defined?(Kgio::TCP_FASTOPEN) |