diff options
author | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-07 18:39:47 +0000 |
---|---|---|
committer | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-07 18:39:47 +0000 |
commit | 889f50227cd01425fd22692d552c5f9a3410373f (patch) | |
tree | d0708f3401a27cf023a8cf5644b3331ab827a25a /ext | |
parent | 6757d13ee17b737464de68eea3d914390ee2787b (diff) | |
download | ruby-889f50227cd01425fd22692d552c5f9a3410373f.tar.gz |
socket: expand docs+tests for recv_io/send_io
* ext/socket/unixsocket.c (unix_send_io): document args
(unix_recv_io): ditto
* test/socket/test_unix.rb (test_fd_passing_class_mode): added
I was working on these when I encountered the problem in
with BasicSocket.for_fd not handling mode args:
https://bugs.ruby-lang.org/issues/11778
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r-- | ext/socket/unixsocket.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ext/socket/unixsocket.c b/ext/socket/unixsocket.c index f768fbc126..2442bc1d12 100644 --- a/ext/socket/unixsocket.c +++ b/ext/socket/unixsocket.c @@ -201,6 +201,8 @@ sendmsg_blocking(void *data) * p stdout.fileno #=> 6 * * stdout.puts "hello" # outputs "hello\n" to standard output. + * + * _io_ may be any kind of IO object or integer file descriptor. */ static VALUE unix_send_io(VALUE sock, VALUE val) @@ -297,6 +299,11 @@ recvmsg_blocking(void *data) * } * } * + * _klass_ will determine the class of _io_ returned (using the + * IO.for_fd singleton method or similar). + * If _klass_ is +nil+, an integer file descriptor is returned. + * + * _mode_ is the same as the argument passed to IO.for_fd */ static VALUE unix_recv_io(int argc, VALUE *argv, VALUE sock) |