1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

update doc.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34418 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2012-02-02 11:51:25 +00:00
parent 2a6ccf6c13
commit 5525d82134

View file

@ -661,6 +661,7 @@ make_inspectname(VALUE node, VALUE service, struct addrinfo *res)
VALUE inspectname = Qnil; VALUE inspectname = Qnil;
if (res) { if (res) {
/* drop redundant information which also shown in address:port part. */
char hbuf[NI_MAXHOST], pbuf[NI_MAXSERV]; char hbuf[NI_MAXHOST], pbuf[NI_MAXSERV];
int ret; int ret;
ret = rb_getnameinfo(res->ai_addr, res->ai_addrlen, hbuf, ret = rb_getnameinfo(res->ai_addr, res->ai_addrlen, hbuf,
@ -1060,7 +1061,7 @@ inspect_sockaddr(VALUE addrinfo, VALUE ret)
* *
* returns a string which shows addrinfo in human-readable form. * returns a string which shows addrinfo in human-readable form.
* *
* Addrinfo.tcp("localhost", 80).inspect #=> "#<Addrinfo: 127.0.0.1:80 TCP (localhost:80)>" * Addrinfo.tcp("localhost", 80).inspect #=> "#<Addrinfo: 127.0.0.1:80 TCP (localhost)>"
* Addrinfo.unix("/tmp/sock").inspect #=> "#<Addrinfo: /tmp/sock SOCK_STREAM>" * Addrinfo.unix("/tmp/sock").inspect #=> "#<Addrinfo: /tmp/sock SOCK_STREAM>"
* *
*/ */
@ -1432,7 +1433,7 @@ addrinfo_to_sockaddr(VALUE self)
* The canonical name is set by Addrinfo.getaddrinfo when AI_CANONNAME is specified. * The canonical name is set by Addrinfo.getaddrinfo when AI_CANONNAME is specified.
* *
* list = Addrinfo.getaddrinfo("www.ruby-lang.org", 80, :INET, :STREAM, nil, Socket::AI_CANONNAME) * list = Addrinfo.getaddrinfo("www.ruby-lang.org", 80, :INET, :STREAM, nil, Socket::AI_CANONNAME)
* p list[0] #=> #<Addrinfo: 221.186.184.68:80 TCP carbon.ruby-lang.org (www.ruby-lang.org:80)> * p list[0] #=> #<Addrinfo: 221.186.184.68:80 TCP carbon.ruby-lang.org (www.ruby-lang.org)>
* p list[0].canonname #=> "carbon.ruby-lang.org" * p list[0].canonname #=> "carbon.ruby-lang.org"
* *
*/ */
@ -1975,8 +1976,8 @@ addrinfo_unix_path(VALUE self)
* because some port numbers, 512 for example, are ambiguous without socktype. * because some port numbers, 512 for example, are ambiguous without socktype.
* *
* Addrinfo.getaddrinfo("www.kame.net", 80, nil, :STREAM) * Addrinfo.getaddrinfo("www.kame.net", 80, nil, :STREAM)
* #=> [#<Addrinfo: 203.178.141.194:80 TCP (www.kame.net:80)>, * #=> [#<Addrinfo: 203.178.141.194:80 TCP (www.kame.net)>,
* # #<Addrinfo: [2001:200:0:8002:203:47ff:fea5:3085]:80 TCP (www.kame.net:80)>] * # #<Addrinfo: [2001:200:dff:fff1:216:3eff:feb1:44d7]:80 TCP (www.kame.net)>]
* *
*/ */
static VALUE static VALUE