ok

Mini Shell

Direktori : /proc/thread-self/root/opt/alt/ruby18/share/ri/1.8/system/TCPSocket/
Upload File :
Current File : //proc/thread-self/root/opt/alt/ruby18/share/ri/1.8/system/TCPSocket/gethostbyname-c.yaml

--- !ruby/object:RI::MethodDescription 
aliases: []

block_params: 
comment: 
- !ruby/struct:SM::Flow::P 
  body: Resolve <tt>host</tt> and return name and address information for it, similarly to gethostbyname(3). <tt>host</tt> can be a domain name or the presentation format of an address.
- !ruby/struct:SM::Flow::P 
  body: "Returns an array of information similar to that found in a +struct hostent+:"
- !ruby/struct:SM::Flow::VERB 
  body: "  - cannonical name: the cannonical name for host in the DNS, or a\n    string representing the address\n  - aliases: an array of aliases for the canonical name, there may be no aliases\n  - address family: usually one of Socket::AF_INET or Socket::AF_INET6\n  - address: a string, the binary value of the +struct sockaddr+ for this name, in\n    the indicated address family\n  - ...: if there are multiple addresses for this host,  a series of\n    strings/+struct sockaddr+s may follow, not all necessarily in the same\n    address family. Note that the fact that they may not be all in the same\n    address family is a departure from the behaviour of gethostbyname(3).\n"
- !ruby/struct:SM::Flow::P 
  body: "Note: I believe that the fact that the multiple addresses returned are not necessarily in the same address family may be a bug, since if this function actually called gethostbyname(3), ALL the addresses returned in the trailing address list (h_addr_list from struct hostent) would be of the same address family! Examples from my system, OS X 10.3:"
- !ruby/struct:SM::Flow::VERB 
  body: "  [&quot;localhost&quot;, [], 30, &quot;\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\001&quot;, &quot;\\177\\000\\000\\001&quot;]\n    and\n  [&quot;ensemble.local&quot;, [], 30, &quot;\\376\\200\\000\\004\\000\\000\\000\\000\\002\\003\\223\\377\\376\\255\\010\\214&quot;, &quot;\\300\\250{\\232&quot; ]\n"
- !ruby/struct:SM::Flow::P 
  body: "Similar information can be returned by Socket.getaddrinfo if called as:"
- !ruby/struct:SM::Flow::VERB 
  body: "   Socket.getaddrinfo(<tt>host</tt>, 0, Socket::AF_UNSPEC, Socket::SOCK_STREAM, nil, Socket::AI_CANONNAME)\n"
- !ruby/struct:SM::Flow::H 
  level: 2
  text: Examples
- !ruby/struct:SM::Flow::VERB 
  body: "  Socket.gethostbyname &quot;example.com&quot;\n  =&gt; [&quot;example.com&quot;, [], 2, &quot;\\300\\000\\&quot;\\246&quot;]\n"
- !ruby/struct:SM::Flow::P 
  body: This name has no DNS aliases, and a single IPv4 address.
- !ruby/struct:SM::Flow::VERB 
  body: "  Socket.gethostbyname &quot;smtp.telus.net&quot;\n  =&gt; [&quot;smtp.svc.telus.net&quot;, [&quot;smtp.telus.net&quot;], 2, &quot;\\307\\271\\334\\371&quot;]\n"
- !ruby/struct:SM::Flow::P 
  body: This name is an an alias so the canonical name is returned, as well as the alias and a single IPv4 address.
- !ruby/struct:SM::Flow::VERB 
  body: "  Socket.gethostbyname &quot;localhost&quot;\n  =&gt; [&quot;localhost&quot;, [], 30, &quot;\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\001&quot;, &quot;\\177\\000\\000\\001&quot;]\n"
- !ruby/struct:SM::Flow::P 
  body: This machine has no aliases, returns an IPv6 address, and has an additional IPv4 address.
- !ruby/struct:SM::Flow::P 
  body: "<tt>host</tt> can also be an IP address in presentation format, in which case a reverse lookup is done on the address:"
- !ruby/struct:SM::Flow::VERB 
  body: "  Socket.gethostbyname(&quot;127.0.0.1&quot;)\n  =&gt; [&quot;localhost&quot;, [], 2, &quot;\\177\\000\\000\\001&quot;]\n\n  Socket.gethostbyname(&quot;192.0.34.166&quot;)\n  =&gt; [&quot;www.example.com&quot;, [], 2, &quot;\\300\\000\\&quot;\\246&quot;]\n"
- !ruby/struct:SM::Flow::H 
  level: 2
  text: See
- !ruby/struct:SM::Flow::P 
  body: "See: Socket.getaddrinfo"
full_name: TCPSocket::gethostbyname
is_singleton: true
name: gethostbyname
params: " Socket.gethostbyname(host) => hostent\n"
visibility: public

Zerion Mini Shell 1.0