socket: update doc for recvfrom_nonblock [ci skip]
* ext/socket/lib/socket.rb (Socket#recvfrom_nonblock): UDPSocket#recvfrom_nonblock): update doc for `exception: false` and destination buffer [ruby-core:69542] [Feature #11229] [ruby-core:69543] [Feature #11242] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
0701e5ff46
commit
55a692bbc2
@ -1,3 +1,11 @@
|
|||||||
|
Tue Nov 17 11:27:23 2015 Eric Wong <e@80x24.org>
|
||||||
|
|
||||||
|
* ext/socket/lib/socket.rb (Socket#recvfrom_nonblock):
|
||||||
|
UDPSocket#recvfrom_nonblock):
|
||||||
|
update doc for `exception: false` and destination buffer
|
||||||
|
[ruby-core:69542] [Feature #11229]
|
||||||
|
[ruby-core:69543] [Feature #11242]
|
||||||
|
|
||||||
Tue Nov 17 11:25:05 2015 Eric Turner <ericturnerdev@gmail.com>
|
Tue Nov 17 11:25:05 2015 Eric Turner <ericturnerdev@gmail.com>
|
||||||
|
|
||||||
* array.c (rb_ary_dig), hash.c (rb_hash_dig): [DOC] Update
|
* array.c (rb_ary_dig), hash.c (rb_hash_dig): [DOC] Update
|
||||||
|
@ -456,8 +456,7 @@ class Socket < BasicSocket
|
|||||||
end
|
end
|
||||||
|
|
||||||
# call-seq:
|
# call-seq:
|
||||||
# socket.recvfrom_nonblock(maxlen) => [mesg, sender_addrinfo]
|
# socket.recvfrom_nonblock(maxlen[, flags[, outbuf[, opts]]]) => [mesg, sender_addrinfo]
|
||||||
# socket.recvfrom_nonblock(maxlen, flags) => [mesg, sender_addrinfo]
|
|
||||||
#
|
#
|
||||||
# Receives up to _maxlen_ bytes from +socket+ using recvfrom(2) after
|
# Receives up to _maxlen_ bytes from +socket+ using recvfrom(2) after
|
||||||
# O_NONBLOCK is set for the underlying file descriptor.
|
# O_NONBLOCK is set for the underlying file descriptor.
|
||||||
@ -473,6 +472,8 @@ class Socket < BasicSocket
|
|||||||
# === Parameters
|
# === Parameters
|
||||||
# * +maxlen+ - the maximum number of bytes to receive from the socket
|
# * +maxlen+ - the maximum number of bytes to receive from the socket
|
||||||
# * +flags+ - zero or more of the +MSG_+ options
|
# * +flags+ - zero or more of the +MSG_+ options
|
||||||
|
# * +outbuf+ - destination String buffer
|
||||||
|
# * +opts+ - keyword hash, supporting `exception: false`
|
||||||
#
|
#
|
||||||
# === Example
|
# === Example
|
||||||
# # In one file, start this first
|
# # In one file, start this first
|
||||||
@ -511,7 +512,12 @@ class Socket < BasicSocket
|
|||||||
#
|
#
|
||||||
# If the exception is Errno::EWOULDBLOCK or Errno::EAGAIN,
|
# If the exception is Errno::EWOULDBLOCK or Errno::EAGAIN,
|
||||||
# it is extended by IO::WaitReadable.
|
# it is extended by IO::WaitReadable.
|
||||||
# So IO::WaitReadable can be used to rescue the exceptions for retrying recvfrom_nonblock.
|
# So IO::WaitReadable can be used to rescue the exceptions for retrying
|
||||||
|
# recvfrom_nonblock.
|
||||||
|
#
|
||||||
|
# By specifying `exception: false`, the options hash allows you to indicate
|
||||||
|
# that accept_nonblock should not raise an IO::WaitReadable exception, but
|
||||||
|
# return the symbol :wait_readable instead.
|
||||||
#
|
#
|
||||||
# === See
|
# === See
|
||||||
# * Socket#recvfrom
|
# * Socket#recvfrom
|
||||||
@ -1204,7 +1210,7 @@ end
|
|||||||
class UDPSocket < IPSocket
|
class UDPSocket < IPSocket
|
||||||
|
|
||||||
# call-seq:
|
# call-seq:
|
||||||
# udpsocket.recvfrom_nonblock(maxlen [, flags [, options]]) => [mesg, sender_inet_addr]
|
# udpsocket.recvfrom_nonblock(maxlen [, flags[, outbuf [, options]]]) => [mesg, sender_inet_addr]
|
||||||
#
|
#
|
||||||
# Receives up to _maxlen_ bytes from +udpsocket+ using recvfrom(2) after
|
# Receives up to _maxlen_ bytes from +udpsocket+ using recvfrom(2) after
|
||||||
# O_NONBLOCK is set for the underlying file descriptor.
|
# O_NONBLOCK is set for the underlying file descriptor.
|
||||||
@ -1220,6 +1226,7 @@ class UDPSocket < IPSocket
|
|||||||
# === Parameters
|
# === Parameters
|
||||||
# * +maxlen+ - the number of bytes to receive from the socket
|
# * +maxlen+ - the number of bytes to receive from the socket
|
||||||
# * +flags+ - zero or more of the +MSG_+ options
|
# * +flags+ - zero or more of the +MSG_+ options
|
||||||
|
# * +outbuf+ - destination String buffer
|
||||||
# * +options+ - keyword hash, supporting `exception: false`
|
# * +options+ - keyword hash, supporting `exception: false`
|
||||||
#
|
#
|
||||||
# === Example
|
# === Example
|
||||||
@ -1254,8 +1261,8 @@ class UDPSocket < IPSocket
|
|||||||
#
|
#
|
||||||
# === See
|
# === See
|
||||||
# * Socket#recvfrom
|
# * Socket#recvfrom
|
||||||
def recvfrom_nonblock(len, flag = 0, str = nil, exception: true)
|
def recvfrom_nonblock(len, flag = 0, outbuf = nil, exception: true)
|
||||||
__recvfrom_nonblock(len, flag, str, exception)
|
__recvfrom_nonblock(len, flag, outbuf, exception)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user