We no longer over-allocate memory for Kgio.poll (1.9.x-only). Under Ruby 1.9.3dev, we also use rb_thread_io_blocking_region to properly deal with cross-thread IO#close.
Thanks to Jeremy Evans, this release fixes the build under OpenBSD.
* connect.c: disable AI_NUMERICSERV It's not needed since we already verify the service is a numeric port. AI_NUMERICSERV is not available in older glibc (<2.3.4) and probably other old systems.
recv() with MSG_PEEK for sockets is added with the try* interface. SocketMethods#kgio_trypeek and SocketMethods#kgio_peek or Kgio.trypeek for non-Kgio-enabled sockets. For Ruby 1.9 only: poll(2) is exposed via the Kgio.poll singleton method and should provide an alternative for IO.select users. Both of these new features should work well on modern Unix-like operating systems.
* sockets accept()ed by a TCP_NOPUSH/TCP_CORK listener automatically flush on kgio_*read calls if there is pending data. "Kgio.autopush = false" disables this globally, and Kgio::Socket also get "kgio_autopush=" to enable/disable on a per-object individual basis. * ECONNRESET exceptions get empty backtraces for kgio_*read. There's nothing a programmer can do about these, so there's no point in going through the expensive backtrace generation process. * Kgio.try* singleton methods added for working with non-Kgio enhanced objects. No more needing to use Object#extend and blowing away your method cache to make existing I/O objects kinder and gentler. * IPv6 support should be complete, systems without a native getaddrinfo(3) are now unsupported (and will remain so unless somebody complains). There should be no other backwards-incompatible changes other than requiring getaddrinfo(3) and friends for IPv6 support.
We now avoid errno side-effects in kgio_wait_*able methods. This affects Rubinius, but may affect other Ruby platforms (particularly those that use stdio) as well.
kgio_accept and kgio_tryaccept now take an optional argument to override the default Kgio::Socket class that is returned. These methods also fall back to using regular accept() if kgio was built on a system with accept4() and later run on a system without accept4().
(no code changes from 2.0.0pre1)
This release should make Kgio easier and more consistent
to use across a variety of libraries/applications.
The global Kgio.wait_*able(=) accessor methods are gone in favor
of having default kgio_wait_readable and kgio_wait_writable
methods added to all Kgio-using classes. Sub-classes may (and
are encouraged to) redefine these if needed.
Eric Wong (7):
expand Kgio::*#kgio_read! documentation
prefer symbolic names for waiting read/writability
EOFError message matches Ruby's
README: Gemcutter => RubyGems.org
update documentation with mailing list info
add default kgio_wait_*able methods
switch entirely to kgio_wait_*able methods
This release should make Kgio easier and more consistent
to use across a variety of libraries/applications.
The global Kgio.wait_*able(=) accessor methods are gone in favor
of having default kgio_wait_readable and kgio_wait_writable
methods added to all Kgio-using classes. Sub-classes may (and
are encouraged to) redefine these if needed.
Eric Wong (7):
expand Kgio::*#kgio_read! documentation
prefer symbolic names for waiting read/writability
EOFError message matches Ruby's
README: Gemcutter => RubyGems.org
update documentation with mailing list info
add default kgio_wait_*able methods
switch entirely to kgio_wait_*able methods
kgio_read and kgio_tryread will now return an empty string when a length of zero is specified instead of nil (which would signal an EOF). This emulates the behavior of IO#read, IO#readpartial, IO#sysread, IO#read_nonblock in core Ruby for consistency.
* make Kgio::WaitWritable and Kgio::WaitReadable symbols * trywrite: fix stupid off-by-one error causing corrupt writes on retries
This fixes our accept4() wrapper which did not work as expected on some *BSD-based systems due to fcntl(fd, F_GETFL) returning false information. Linux 2.6+ users are unnaffected, including those without accept4(). Also some RDoc fixes.
The C extension is now split into several files for ease-of-maintenance. Slightly more common, client-triggerable exceptions (EOFError, Errno::EPIPE, Errno::ECONNRESET) are now less expensive as they are generated without backtraces.
* alternate classes may now be returned by accept/tryaccept by setting Kgio.accept_class=
* add compatibility for ancient Rubies (1.8.6) * linux: fix accept4() support for newer Linux
A kinder, gentler I/O library for Ruby
Generated with the Darkfish Rdoc Generator 2.