kgio 2.11.0 → 2.11.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.olddoc.yml +12 -6
- data/GIT-VERSION-GEN +1 -1
- data/GNUmakefile +1 -1
- data/HACKING +7 -9
- data/ISSUES +7 -14
- data/README +10 -11
- data/ext/kgio/accept.c +4 -1
- data/ext/kgio/wait.c +2 -2
- data/kgio.gemspec +13 -10
- data/pkg.mk +4 -3
- data/test/lib_read_write.rb +2 -0
- data/test/lib_server_accept.rb +7 -4
- data/test/test_accept_class.rb +10 -8
- data/test/test_connect_fd_leak.rb +1 -0
- data/test/test_kgio_addr.rb +1 -0
- data/test/test_poll.rb +4 -6
- data/test/test_syssend.rb +2 -0
- data/test/test_tcp6_client_read_server_write.rb +1 -0
- data/test/test_tryopen.rb +3 -2
- metadata +10 -26
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: c36b15dff6b808be5cbae062c2f35f6950ebe6b2a7cf66259f39fd56c8377d71
|
|
4
|
+
data.tar.gz: 10d177145a5254091c8f4ce8fe8a859a174874d1c24e1ccf7b6418038511cb54
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9baa356925aefef55424e43d3eb84bc604cfb741bf78768cdce3ad22af620919c60c625ede9053a6a1e2a71dacbca83cfb26171b664bdfbf869ef699cac90ffa
|
|
7
|
+
data.tar.gz: f0a9c31c444ea3cb35fc8ca268b99766196b9fa056833ee3134afe871595da5a152f635b26c5f646a79c815b53fb9a99f6e64865ab7f2e2cd79e9bd9f6423aff
|
data/.olddoc.yml
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
---
|
|
2
|
-
cgit_url:
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
cgit_url: https://yhbt.net/kgio.git
|
|
3
|
+
ml_url:
|
|
4
|
+
- https://yhbt.net/kgio-public/
|
|
5
|
+
- http://7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/kgio-public/
|
|
6
|
+
rdoc_url: https://yhbt.net/kgio/
|
|
7
|
+
public_email: kgio-public@yhbt.net
|
|
8
8
|
noindex:
|
|
9
9
|
- LATEST
|
|
10
10
|
- TODO
|
|
11
|
+
nntp_url:
|
|
12
|
+
- nntp://news.public-inbox.org/inbox.comp.lang.ruby.kgio
|
|
13
|
+
- nntp://7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/inbox.comp.lang.ruby.kgio
|
|
14
|
+
source_code:
|
|
15
|
+
- git clone https://yhbt.net/kgio.git
|
|
16
|
+
- torsocks git clone http://7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/kgio.git
|
data/GIT-VERSION-GEN
CHANGED
data/GNUmakefile
CHANGED
data/HACKING
CHANGED
|
@@ -2,14 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
=== Documentation
|
|
4
4
|
|
|
5
|
-
We use the latest version of {olddoc}[http://80x24.org/olddoc/] as
|
|
6
|
-
much as possible.
|
|
7
|
-
|
|
8
5
|
Please wrap documentation at 72 characters-per-line or less (long URLs
|
|
9
6
|
are exempt) so it is comfortably readable from terminals.
|
|
10
7
|
|
|
11
8
|
When referencing mailing list posts, use
|
|
12
|
-
|
|
9
|
+
<tt>https://yhbt.net/kgio-public/$MESSAGE_ID/</tt> if possible
|
|
13
10
|
Message-ID remains searchable even if the archive becomes unavailable.
|
|
14
11
|
|
|
15
12
|
=== Code Compatibility
|
|
@@ -26,11 +23,12 @@ characters wide) and NOT the indentation style of Matz Ruby.
|
|
|
26
23
|
|
|
27
24
|
== Contributing
|
|
28
25
|
|
|
29
|
-
Contributions are welcome in the form of patches, pull requests
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
26
|
+
Contributions are welcome in the form of patches, pull requests
|
|
27
|
+
(format email with "git request-pull"), code review, testing,
|
|
28
|
+
documentation, user support or any other feedback.
|
|
29
|
+
<mailto:kgio-public@yhbt.net> <https://yhbt.net/kgio-public/> is the
|
|
30
|
+
current coordination point for all user and developer feedback and
|
|
31
|
+
bug reports (domain is subject to change since ICANN cannot be trusted).
|
|
34
32
|
|
|
35
33
|
=== Submitting Patches
|
|
36
34
|
|
data/ISSUES
CHANGED
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
= Issues
|
|
2
2
|
|
|
3
|
-
The kgio {mailing list}[mailto:kgio-public@
|
|
3
|
+
The kgio {mailing list}[mailto:kgio-public@yhbt.net] is the best
|
|
4
4
|
place to report bugs, submit patches and/or obtain support after you
|
|
5
|
-
have searched the mailing list archives at
|
|
6
|
-
and {documentation}[
|
|
5
|
+
have searched the mailing list archives at https://yhbt.net/kgio-public/
|
|
6
|
+
and {documentation}[https://yhbt.net/kgio/].
|
|
7
7
|
|
|
8
8
|
* Do not {top post}[http://catb.org/jargon/html/T/top-post.html] in replies
|
|
9
9
|
* Quote only the relevant portions of the message you're replying to
|
|
10
10
|
* Do not send any HTML mail at all
|
|
11
11
|
|
|
12
|
-
If your issue is of a sensitive nature or you're just shy in public,
|
|
13
|
-
then feel free to email us privately at mailto:kgio@bogomips.org
|
|
14
|
-
instead and your issue will be handled discreetly.
|
|
15
|
-
|
|
16
12
|
If you don't get a response within a few days, we may have forgotten
|
|
17
13
|
about it so feel free to ask again.
|
|
18
14
|
|
|
@@ -24,13 +20,10 @@ guidelines for patch submission.
|
|
|
24
20
|
|
|
25
21
|
== Mailing List Info
|
|
26
22
|
|
|
27
|
-
* subscribe: mailto:kgio-public+subscribe@
|
|
28
|
-
* post: mailto:kgio-public@
|
|
29
|
-
* private: mailto:kgio@bogomips.org
|
|
23
|
+
* subscribe: mailto:kgio-public+subscribe@yhbt.net
|
|
24
|
+
* post: mailto:kgio-public@yhbt.net
|
|
30
25
|
|
|
31
26
|
== Mailing List Archives
|
|
32
27
|
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
(see http://ssoma.public-inbox.org/ for layout)
|
|
36
|
-
* NNTP coming soon
|
|
28
|
+
* https://yhbt.net/kgio-public/
|
|
29
|
+
* nntp://news.public-inbox.org/inbox.comp.lang.ruby.kgio
|
data/README
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
= kgio - kinder, gentler I/O for Ruby
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
This is a legacy project, do not use it for new projects. Ruby
|
|
4
|
+
2.3 and later should make this obsolete. kgio provides
|
|
5
|
+
non-blocking I/O methods for Ruby without raising exceptions on
|
|
6
|
+
EAGAIN and EINPROGRESS.
|
|
7
7
|
|
|
8
8
|
== Features
|
|
9
9
|
|
|
@@ -11,7 +11,7 @@ Unix-like platforms).
|
|
|
11
11
|
returning :wait_readable or :wait_writable instead.
|
|
12
12
|
These exceptions got more expensive to hit under Ruby 1.9.2
|
|
13
13
|
(but were fixed in Ruby 1.9.3 and later to 1.9.1 performance levels,
|
|
14
|
-
|
|
14
|
+
which were still bad)
|
|
15
15
|
|
|
16
16
|
* Returns the unwritten portion of the string on partial writes,
|
|
17
17
|
making it ideal for buffering unwritten data.
|
|
@@ -21,9 +21,8 @@ Unix-like platforms).
|
|
|
21
21
|
callbacks (such as adding the file descriptor to a poll set and yielding
|
|
22
22
|
the current Fiber).
|
|
23
23
|
|
|
24
|
-
* Uses
|
|
25
|
-
|
|
26
|
-
on new GNU/Linux systems to avoid unnecessary fcntl() calls
|
|
24
|
+
* Uses {accept4}[http://man7.org/linux/man-pages/man2/accept4.2.html]
|
|
25
|
+
on newer GNU/Linux systems to avoid unnecessary fcntl() calls
|
|
27
26
|
|
|
28
27
|
* Uses MSG_DONTWAIT on GNU/Linux to further avoid unnecessary fcntl() calls
|
|
29
28
|
|
|
@@ -40,13 +39,13 @@ You may install it via RubyGems.org:
|
|
|
40
39
|
You can get the latest source via git from the following locations
|
|
41
40
|
(these versions may not be stable):
|
|
42
41
|
|
|
43
|
-
git://
|
|
42
|
+
git://yhbt.net/kgio.git
|
|
44
43
|
git://repo.or.cz/kgio.git (mirror)
|
|
45
44
|
|
|
46
45
|
You may browse the code from the web and download the latest snapshot
|
|
47
46
|
tarballs here:
|
|
48
47
|
|
|
49
|
-
*
|
|
48
|
+
* https://yhbt.net/kgio.git
|
|
50
49
|
* http://repo.or.cz/w/kgio.git (gitweb)
|
|
51
50
|
|
|
52
51
|
See the HACKING guide on how to contribute and build prerelease gems
|
|
@@ -56,7 +55,7 @@ from git.
|
|
|
56
55
|
|
|
57
56
|
All feedback (bug reports, user/development dicussion, patches, pull
|
|
58
57
|
requests) go to the mailing list/newsgroup. See the ISSUES document for
|
|
59
|
-
information on the {kgio mailing list}[mailto:kgio-public@
|
|
58
|
+
information on the {kgio mailing list}[mailto:kgio-public@yhbt.net]
|
|
60
59
|
|
|
61
60
|
For the latest on kgio releases, you may check our NEWS page (and
|
|
62
61
|
subscribe to our Atom feed).
|
data/ext/kgio/accept.c
CHANGED
|
@@ -40,7 +40,7 @@ static VALUE set_accepted(VALUE klass, VALUE aclass)
|
|
|
40
40
|
if (NIL_P(aclass))
|
|
41
41
|
aclass = cKgio_Socket;
|
|
42
42
|
|
|
43
|
-
tmp = rb_funcall(aclass, rb_intern("included_modules"), 0
|
|
43
|
+
tmp = rb_funcall(aclass, rb_intern("included_modules"), 0);
|
|
44
44
|
tmp = rb_funcall(tmp, rb_intern("include?"), 1, mSocketMethods);
|
|
45
45
|
|
|
46
46
|
if (tmp != Qtrue)
|
|
@@ -498,9 +498,12 @@ void init_kgio_accept(void)
|
|
|
498
498
|
rb_define_const(mKgio, "SOCK_CLOEXEC", INT2NUM(SOCK_CLOEXEC));
|
|
499
499
|
|
|
500
500
|
localhost = rb_const_get(mKgio, rb_intern("LOCALHOST"));
|
|
501
|
+
rb_gc_register_mark_object(localhost);
|
|
501
502
|
cKgio_Socket = rb_const_get(mKgio, rb_intern("Socket"));
|
|
503
|
+
rb_gc_register_mark_object(cKgio_Socket);
|
|
502
504
|
cClientSocket = cKgio_Socket;
|
|
503
505
|
mSocketMethods = rb_const_get(mKgio, rb_intern("SocketMethods"));
|
|
506
|
+
rb_gc_register_mark_object(mSocketMethods);
|
|
504
507
|
|
|
505
508
|
rb_define_method(mSocketMethods, "kgio_addr!", addr_bang, 0);
|
|
506
509
|
|
data/ext/kgio/wait.c
CHANGED
|
@@ -92,12 +92,12 @@ static VALUE kgio_wait_writable(int argc, VALUE *argv, VALUE self)
|
|
|
92
92
|
|
|
93
93
|
VALUE kgio_call_wait_writable(VALUE io)
|
|
94
94
|
{
|
|
95
|
-
return rb_funcall(io, id_wait_wr, 0
|
|
95
|
+
return rb_funcall(io, id_wait_wr, 0);
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
VALUE kgio_call_wait_readable(VALUE io)
|
|
99
99
|
{
|
|
100
|
-
return rb_funcall(io, id_wait_rd, 0
|
|
100
|
+
return rb_funcall(io, id_wait_rd, 0);
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
void init_kgio_wait(void)
|
data/kgio.gemspec
CHANGED
|
@@ -1,23 +1,26 @@
|
|
|
1
1
|
ENV["VERSION"] or abort "VERSION= must be specified"
|
|
2
2
|
manifest = File.readlines('.manifest').map! { |x| x.chomp! }
|
|
3
|
-
require 'olddoc'
|
|
4
|
-
extend Olddoc::Gemspec
|
|
5
|
-
name, summary, title = readme_metadata
|
|
6
3
|
|
|
7
4
|
Gem::Specification.new do |s|
|
|
8
5
|
s.name = %q{kgio}
|
|
9
6
|
s.version = ENV["VERSION"].dup
|
|
10
|
-
s.homepage =
|
|
11
|
-
s.authors = [
|
|
12
|
-
s.description =
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
s.homepage = 'https://yhbt.net/kgio/'
|
|
8
|
+
s.authors = ['kgio hackers']
|
|
9
|
+
s.description = <<EOF
|
|
10
|
+
This is a legacy project, do not use it for new projects. Ruby
|
|
11
|
+
2.3 and later should make this obsolete. kgio provides
|
|
12
|
+
non-blocking I/O methods for Ruby without raising exceptions on
|
|
13
|
+
EAGAIN and EINPROGRESS.
|
|
14
|
+
EOF
|
|
15
|
+
s.email = %q{kgio-public@yhbt.net}
|
|
16
|
+
s.extra_rdoc_files = IO.readlines('.document').map!(&:chomp!).keep_if do |f|
|
|
17
|
+
File.exist?(f)
|
|
18
|
+
end
|
|
15
19
|
s.files = manifest
|
|
16
|
-
s.summary =
|
|
20
|
+
s.summary = 'kinder, gentler I/O for Ruby'
|
|
17
21
|
s.test_files = Dir['test/test_*.rb']
|
|
18
22
|
s.extensions = %w(ext/kgio/extconf.rb)
|
|
19
23
|
|
|
20
|
-
s.add_development_dependency('olddoc', '~> 1.0')
|
|
21
24
|
s.add_development_dependency('test-unit', '~> 3.0')
|
|
22
25
|
# s.add_development_dependency('strace_me', '~> 1.0') # Linux only
|
|
23
26
|
|
data/pkg.mk
CHANGED
|
@@ -60,7 +60,7 @@ doc:: .document .olddoc.yml $(pkg_extra) $(PLACEHOLDERS)
|
|
|
60
60
|
-find lib -type f -name '*.rbc' -exec rm -f '{}' ';'
|
|
61
61
|
-find ext -type f -name '*.rbc' -exec rm -f '{}' ';'
|
|
62
62
|
$(RM) -r doc
|
|
63
|
-
$(RDOC) -f
|
|
63
|
+
$(RDOC) -f dark216
|
|
64
64
|
$(OLDDOC) merge
|
|
65
65
|
install -m644 COPYING doc/COPYING
|
|
66
66
|
install -m644 NEWS doc/NEWS
|
|
@@ -86,7 +86,7 @@ fix-perms:
|
|
|
86
86
|
gem: $(pkggem)
|
|
87
87
|
|
|
88
88
|
install-gem: $(pkggem)
|
|
89
|
-
gem install $(CURDIR)/$<
|
|
89
|
+
gem install --local $(CURDIR)/$<
|
|
90
90
|
|
|
91
91
|
$(pkggem): manifest fix-perms
|
|
92
92
|
gem build $(rfpackage).gemspec
|
|
@@ -127,7 +127,8 @@ publish_doc:
|
|
|
127
127
|
-git set-file-times
|
|
128
128
|
$(MAKE) doc
|
|
129
129
|
$(MAKE) doc_gz
|
|
130
|
-
$(RSYNC) -av doc/ $(RSYNC_DEST)/
|
|
130
|
+
$(RSYNC) -av doc/ $(RSYNC_DEST)/ \
|
|
131
|
+
--exclude index.html* --exclude created.rid*
|
|
131
132
|
git ls-files | xargs touch
|
|
132
133
|
endif
|
|
133
134
|
|
data/test/lib_read_write.rb
CHANGED
|
@@ -166,6 +166,7 @@ module LibReadWriteTest
|
|
|
166
166
|
rescue EOFError
|
|
167
167
|
break
|
|
168
168
|
rescue => e
|
|
169
|
+
warn "#{e.message} (#{e.class})"
|
|
169
170
|
end while true
|
|
170
171
|
dig.hexdigest
|
|
171
172
|
end
|
|
@@ -203,6 +204,7 @@ module LibReadWriteTest
|
|
|
203
204
|
rescue EOFError
|
|
204
205
|
break
|
|
205
206
|
rescue => e
|
|
207
|
+
warn "#{e.message} (#{e.class})"
|
|
206
208
|
end while true
|
|
207
209
|
dig.hexdigest
|
|
208
210
|
end
|
data/test/lib_server_accept.rb
CHANGED
|
@@ -20,6 +20,7 @@ module LibServerAccept
|
|
|
20
20
|
b = @srv.kgio_tryaccept
|
|
21
21
|
assert_kind_of Kgio::Socket, b
|
|
22
22
|
assert_equal @host, b.kgio_addr
|
|
23
|
+
a.close
|
|
23
24
|
end
|
|
24
25
|
|
|
25
26
|
def test_tryaccept_flags
|
|
@@ -28,6 +29,7 @@ module LibServerAccept
|
|
|
28
29
|
b = @srv.kgio_tryaccept nil, 0
|
|
29
30
|
assert_kind_of Kgio::Socket, b
|
|
30
31
|
assert_equal 0, b.fcntl(Fcntl::F_GETFD)
|
|
32
|
+
a.close
|
|
31
33
|
end
|
|
32
34
|
|
|
33
35
|
def test_blocking_accept_flags
|
|
@@ -36,6 +38,7 @@ module LibServerAccept
|
|
|
36
38
|
b = @srv.kgio_accept nil, 0
|
|
37
39
|
assert_kind_of Kgio::Socket, b
|
|
38
40
|
assert_equal 0, b.fcntl(Fcntl::F_GETFD)
|
|
41
|
+
a.close
|
|
39
42
|
end
|
|
40
43
|
|
|
41
44
|
def test_tryaccept_fail
|
|
@@ -44,7 +47,7 @@ module LibServerAccept
|
|
|
44
47
|
|
|
45
48
|
def test_blocking_accept
|
|
46
49
|
t0 = Time.now
|
|
47
|
-
pid = fork { sleep 1; a = client_connect; sleep }
|
|
50
|
+
pid = fork { sleep 1; a = client_connect; sleep; a.close }
|
|
48
51
|
b = @srv.kgio_accept
|
|
49
52
|
elapsed = Time.now - t0
|
|
50
53
|
assert_kind_of Kgio::Socket, b
|
|
@@ -57,7 +60,7 @@ module LibServerAccept
|
|
|
57
60
|
def test_blocking_accept_with_nonblock_socket
|
|
58
61
|
@srv.nonblock = true
|
|
59
62
|
t0 = Time.now
|
|
60
|
-
pid = fork { sleep 1; a = client_connect; sleep }
|
|
63
|
+
pid = fork { sleep 1; a = client_connect; sleep; a.close }
|
|
61
64
|
b = @srv.kgio_accept
|
|
62
65
|
elapsed = Time.now - t0
|
|
63
66
|
assert_kind_of Kgio::Socket, b
|
|
@@ -67,7 +70,7 @@ module LibServerAccept
|
|
|
67
70
|
assert elapsed >= 1, "elapsed: #{elapsed}"
|
|
68
71
|
|
|
69
72
|
t0 = Time.now
|
|
70
|
-
pid = fork { sleep 6; a = client_connect; sleep }
|
|
73
|
+
pid = fork { sleep 6; a = client_connect; sleep; a.close }
|
|
71
74
|
b = @srv.kgio_accept
|
|
72
75
|
elapsed = Time.now - t0
|
|
73
76
|
assert_kind_of Kgio::Socket, b
|
|
@@ -77,7 +80,7 @@ module LibServerAccept
|
|
|
77
80
|
assert elapsed >= 6, "elapsed: #{elapsed}"
|
|
78
81
|
|
|
79
82
|
t0 = Time.now
|
|
80
|
-
pid = fork { sleep 1; a = client_connect; sleep }
|
|
83
|
+
pid = fork { sleep 1; a = client_connect; sleep; a.close }
|
|
81
84
|
b = @srv.kgio_accept
|
|
82
85
|
elapsed = Time.now - t0
|
|
83
86
|
assert_kind_of Kgio::Socket, b
|
data/test/test_accept_class.rb
CHANGED
|
@@ -30,33 +30,35 @@ class TestAcceptClass < Test::Unit::TestCase
|
|
|
30
30
|
@host = ENV["TEST_HOST"] || '127.0.0.1'
|
|
31
31
|
@srv = Kgio::TCPServer.new(@host, 0)
|
|
32
32
|
@port = @srv.addr[1]
|
|
33
|
+
socks = []
|
|
33
34
|
|
|
34
35
|
Kgio.accept_class = Kgio::TCPSocket
|
|
35
|
-
|
|
36
|
+
socks << TCPSocket.new(@host, @port)
|
|
36
37
|
assert_instance_of Kgio::TCPSocket, @srv.kgio_accept
|
|
37
|
-
|
|
38
|
+
socks << TCPSocket.new(@host, @port)
|
|
38
39
|
IO.select([@srv])
|
|
39
40
|
assert_instance_of Kgio::TCPSocket, @srv.kgio_tryaccept
|
|
40
41
|
|
|
41
42
|
Kgio.accept_class = nil
|
|
42
|
-
|
|
43
|
+
socks << TCPSocket.new(@host, @port)
|
|
43
44
|
assert_instance_of Kgio::Socket, @srv.kgio_accept
|
|
44
|
-
|
|
45
|
+
socks << TCPSocket.new(@host, @port)
|
|
45
46
|
IO.select([@srv])
|
|
46
47
|
assert_instance_of Kgio::Socket, @srv.kgio_tryaccept
|
|
47
48
|
|
|
48
49
|
Kgio.accept_class = Kgio::UNIXSocket
|
|
49
|
-
|
|
50
|
+
socks << TCPSocket.new(@host, @port)
|
|
50
51
|
assert_instance_of Kgio::UNIXSocket, @srv.kgio_accept
|
|
51
|
-
|
|
52
|
+
socks << TCPSocket.new(@host, @port)
|
|
52
53
|
IO.select([@srv])
|
|
53
54
|
assert_instance_of Kgio::UNIXSocket, @srv.kgio_tryaccept
|
|
54
55
|
|
|
55
|
-
|
|
56
|
+
socks << TCPSocket.new(@host, @port)
|
|
56
57
|
assert_instance_of FooSocket, @srv.kgio_accept(FooSocket)
|
|
57
58
|
|
|
58
|
-
|
|
59
|
+
socks << TCPSocket.new(@host, @port)
|
|
59
60
|
IO.select([@srv])
|
|
60
61
|
assert_instance_of FooSocket, @srv.kgio_tryaccept(FooSocket)
|
|
62
|
+
socks.each(&:close)
|
|
61
63
|
end
|
|
62
64
|
end
|
data/test/test_kgio_addr.rb
CHANGED
data/test/test_poll.rb
CHANGED
|
@@ -43,7 +43,6 @@ class TestPoll < Test::Unit::TestCase
|
|
|
43
43
|
end
|
|
44
44
|
|
|
45
45
|
def test_poll_close
|
|
46
|
-
foo = nil
|
|
47
46
|
thr = Thread.new { sleep 0.100; @wr.close }
|
|
48
47
|
t0 = Time.now
|
|
49
48
|
res = Kgio.poll({@rd => Kgio::POLLIN})
|
|
@@ -55,7 +54,6 @@ class TestPoll < Test::Unit::TestCase
|
|
|
55
54
|
|
|
56
55
|
def test_signal_close
|
|
57
56
|
orig = trap(:USR1) { @rd.close }
|
|
58
|
-
res = nil
|
|
59
57
|
thr = Thread.new { sleep 0.100; Process.kill(:USR1, $$) }
|
|
60
58
|
t0 = Time.now
|
|
61
59
|
assert_raises(IOError) do
|
|
@@ -65,8 +63,8 @@ class TestPoll < Test::Unit::TestCase
|
|
|
65
63
|
diff = Time.now - t0
|
|
66
64
|
thr.join
|
|
67
65
|
assert diff >= 0.010, "diff=#{diff}"
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
ensure
|
|
67
|
+
trap(:USR1, orig)
|
|
70
68
|
end
|
|
71
69
|
|
|
72
70
|
def test_poll_EINTR
|
|
@@ -83,8 +81,8 @@ class TestPoll < Test::Unit::TestCase
|
|
|
83
81
|
assert_nil res
|
|
84
82
|
assert diff >= 1.0, "diff=#{diff}"
|
|
85
83
|
assert ok
|
|
86
|
-
|
|
87
|
-
|
|
84
|
+
ensure
|
|
85
|
+
trap(:USR1, orig)
|
|
88
86
|
end
|
|
89
87
|
|
|
90
88
|
def test_poll_signal_torture
|
data/test/test_syssend.rb
CHANGED
|
@@ -37,6 +37,8 @@ class TestKgioSyssend < Test::Unit::TestCase
|
|
|
37
37
|
# blocking
|
|
38
38
|
th = Thread.new { loop { acc.kgio_syssend("ZZZZ", 0) } }
|
|
39
39
|
assert_nil th.join(0.1)
|
|
40
|
+
th.kill
|
|
41
|
+
assert th.join(10), 'thread should be killed'
|
|
40
42
|
ensure
|
|
41
43
|
[ srv, acc, client ].each { |io| io.close if io }
|
|
42
44
|
end
|
data/test/test_tryopen.rb
CHANGED
|
@@ -59,8 +59,9 @@ class TestTryopen < Test::Unit::TestCase
|
|
|
59
59
|
tmp.close!
|
|
60
60
|
file = Kgio::File.tryopen(path, IO::RDWR|IO::CREAT, 0000)
|
|
61
61
|
assert_equal 0100000, File.stat(path).mode
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
file.close
|
|
63
|
+
ensure
|
|
64
|
+
File.unlink path
|
|
64
65
|
end
|
|
65
66
|
|
|
66
67
|
require "benchmark"
|
metadata
CHANGED
|
@@ -1,29 +1,15 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: kgio
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.11.
|
|
4
|
+
version: 2.11.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- kgio hackers
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2021-05-25 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
|
-
- !ruby/object:Gem::Dependency
|
|
14
|
-
name: olddoc
|
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
|
16
|
-
requirements:
|
|
17
|
-
- - "~>"
|
|
18
|
-
- !ruby/object:Gem::Version
|
|
19
|
-
version: '1.0'
|
|
20
|
-
type: :development
|
|
21
|
-
prerelease: false
|
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
-
requirements:
|
|
24
|
-
- - "~>"
|
|
25
|
-
- !ruby/object:Gem::Version
|
|
26
|
-
version: '1.0'
|
|
27
13
|
- !ruby/object:Gem::Dependency
|
|
28
14
|
name: test-unit
|
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -38,12 +24,12 @@ dependencies:
|
|
|
38
24
|
- - "~>"
|
|
39
25
|
- !ruby/object:Gem::Version
|
|
40
26
|
version: '3.0'
|
|
41
|
-
description:
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
email: kgio-public@
|
|
27
|
+
description: |
|
|
28
|
+
This is a legacy project, do not use it for new projects. Ruby
|
|
29
|
+
2.3 and later should make this obsolete. kgio provides
|
|
30
|
+
non-blocking I/O methods for Ruby without raising exceptions on
|
|
31
|
+
EAGAIN and EINPROGRESS.
|
|
32
|
+
email: kgio-public@yhbt.net
|
|
47
33
|
executables: []
|
|
48
34
|
extensions:
|
|
49
35
|
- ext/kgio/extconf.rb
|
|
@@ -55,7 +41,6 @@ extra_rdoc_files:
|
|
|
55
41
|
- LATEST
|
|
56
42
|
- ISSUES
|
|
57
43
|
- HACKING
|
|
58
|
-
- lib/kgio.rb
|
|
59
44
|
- ext/kgio/accept.c
|
|
60
45
|
- ext/kgio/autopush.c
|
|
61
46
|
- ext/kgio/connect.c
|
|
@@ -134,7 +119,7 @@ files:
|
|
|
134
119
|
- test/test_unix_connect.rb
|
|
135
120
|
- test/test_unix_server.rb
|
|
136
121
|
- test/test_unix_server_read_client_write.rb
|
|
137
|
-
homepage:
|
|
122
|
+
homepage: https://yhbt.net/kgio/
|
|
138
123
|
licenses:
|
|
139
124
|
- LGPL-2.1+
|
|
140
125
|
metadata: {}
|
|
@@ -153,8 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
153
138
|
- !ruby/object:Gem::Version
|
|
154
139
|
version: '0'
|
|
155
140
|
requirements: []
|
|
156
|
-
|
|
157
|
-
rubygems_version: 2.6.8
|
|
141
|
+
rubygems_version: 3.0.2
|
|
158
142
|
signing_key:
|
|
159
143
|
specification_version: 4
|
|
160
144
|
summary: kinder, gentler I/O for Ruby
|