1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/ext
normal b9a91334c5 socket: allow exception-free nonblocking sendmsg/recvmsg
As documented before, exceptions are expensive and IO::Wait*able are too
common in socket applications to be the exceptional case.  Datagram
sockets deserve the same API which stream sockets are allowed with
read_nonblock and write_nonblock.

Note: this does not offer a performance advantage under optimal
conditions when both ends are equally matched in speed, but it it
does make debug output cleaner by avoiding exceptions whenever
the receiver slows down.

* ext/socket/ancdata.c (bsock_sendmsg_internal, bsock_recvmsg_internal):
  support "exception: false" kwarg
* ext/socket/init.c (rsock_s_recvfrom_nonblock):
  ditto
* ext/socket/init.c (rsock_s_recvfrom_nonblock): use rsock_opt_false_p
* ext/socket/socket.c (sock_connect_nonblock): ditto
* ext/socket/rubysocket.h (rsock_opt_false_p): new function
* ext/socket/basicsocket.c (bsock_recv_nonblock): update rdoc
* ext/socket/udpsocket.c (udp_recvfrom_nonblock): ditto
* test/socket/test_nonblock.rb: new tests

[ruby-core:69542] [Feature #11229]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-15 19:38:49 +00:00
..
-test- call_without_gvl.c: no sys/select.h 2015-06-14 23:23:48 +00:00
bigdecimal * ext/bigdecimal/bigdecimal.gemspec: Fix require paths for released gem. 2015-06-13 02:35:25 +00:00
continuation continuation.c: quiet static-linked-ext 2014-11-27 19:58:04 +00:00
coverage * ext/coverage/coverage.c: Remove extension from require argument. 2015-04-12 04:52:23 +00:00
date * ext/date/date_core.c: Grammar fix found by @aiperon [ci skip] 2015-06-12 14:45:56 +00:00
dbm dbm.c: fix doc 2014-12-30 00:29:28 +00:00
digest digest.c: GC guard 2015-05-21 05:03:55 +00:00
etc ext: suppress warnings 2015-04-19 03:19:20 +00:00
fcntl protoize no-arguments functions 2014-09-30 05:25:32 +00:00
fiber
fiddle * ext/fiddle/depend: Fix "Wrong mix of special targets" error with 2015-04-12 00:10:52 +00:00
gdbm use 0 for reserved 2014-12-01 06:38:04 +00:00
io * ext/io/console/depend (.list.chksum): revert a part of r50859, because 2015-06-13 10:47:30 +00:00
json generator.c: allocate structs with wrapper 2015-05-28 07:17:55 +00:00
mathn
nkf nkf.c: add semicolon 2014-12-26 06:09:31 +00:00
objspace * ext/objspace/objspace.c: add two methods to debug internals. 2015-05-28 19:40:04 +00:00
openssl * ext/openssl/ossl_ocsp.c: fix documentation on ocsp response cert status. 2015-06-13 02:38:46 +00:00
pathname * ext/pathname/lib/pathname.rb (descend): Blockless form supported. 2015-06-14 15:14:46 +00:00
psych psych: allocate structs with wrapper 2015-05-29 05:44:01 +00:00
pty * internal.h (rb_execarg_parent_end): Declared. 2015-04-09 12:44:35 +00:00
racc/cparse cparse.c: typed data 2014-12-03 00:48:59 +00:00
rbconfig/sizeof * ext/rbconfig/sizeof/extconf.rb: Check C99 standard integer types. 2015-06-03 12:14:21 +00:00
readline readline.c: initialize before rl_refresh_line 2015-01-14 06:43:50 +00:00
ripper Update dependencies. 2014-12-19 13:34:54 +00:00
sdbm _sdbm.c: fix pointers to shift 2015-02-04 08:35:08 +00:00
socket socket: allow exception-free nonblocking sendmsg/recvmsg 2015-06-15 19:38:49 +00:00
stringio stringio.c: don't raise after close 2015-03-13 06:04:39 +00:00
strscan allocate structs with wrapper 2015-05-16 12:56:48 +00:00
syslog Update dependencies. 2014-12-19 13:34:54 +00:00
thread thread.c: refine enums 2015-02-27 03:55:00 +00:00
tk tkutil.c: fix out-of-bounds access 2015-06-01 01:55:10 +00:00
win32 * ext/win32/Win32API.rb (initialize): accept both a string and an array 2015-02-25 13:08:01 +00:00
win32ole * ext/win32ole/win32ole.c: fix a typo. Patch by @davydovanton 2015-06-04 02:53:11 +00:00
zlib * ext/zlib/zlib.c: Fix indentation for rdoc. 2015-06-11 10:11:30 +00:00
.document
extmk.rb extmk.rb: extract CLEANFILES and DISTCLEANFILES 2015-01-21 04:22:07 +00:00
Setup * ext/dl/*: remove DL as it is replaced by Fiddle. 2014-10-31 21:13:09 +00:00
Setup.atheos * ext/dl/*: remove DL as it is replaced by Fiddle. 2014-10-31 21:13:09 +00:00
Setup.emx * ext/dl/*: remove DL as it is replaced by Fiddle. 2014-10-31 21:13:09 +00:00
Setup.nacl * ext/dl/*: remove DL as it is replaced by Fiddle. 2014-10-31 21:13:09 +00:00
Setup.nt * ext/dl/*: remove DL as it is replaced by Fiddle. 2014-10-31 21:13:09 +00:00