U:RDoc::AnyMethod[iI"new:ETI"Addrinfo::new;TT: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [ I")returns a new instance of Addrinfo. ;TI"AThe instance contains sockaddr, family, socktype, protocol. ;TI"Ksockaddr means struct sockaddr which can be used for connect(2), etc. ;TI"Yfamily, socktype and protocol are integers which is used for arguments of socket(2).;To:RDoc::Markup::BlankLineo; ; [ I"4sockaddr is specified as an array or a string. ;TI"VThe array should be compatible to the value of IPSocket#addr or UNIXSocket#addr. ;TI":The string should be struct sockaddr as generated by ;TI"5Socket.sockaddr_in or Socket.unpack_sockaddr_un.;T@o; ; [I"sockaddr examples:;To:RDoc::Markup::List: @type: BULLET: @items[ o:RDoc::Markup::ListItem: @label0; [o; ; : LABEL;[o;;[I";"AF_INET", 46102, "localhost.localdomain", "127.0.0.1";T; [@o;;0; [o; ; ;;[o;;[I"."AF_INET6", 42304, "ip6-localhost", "::1";T; [@o;;0; [o; ; ;;[o;;[I""AF_UNIX", "/tmp/sock";T; [@o;;0; [o; ; [I".Socket.sockaddr_in("smtp", "2001:DB8::1");To;;0; [o; ; [I"+Socket.sockaddr_in(80, "172.18.22.42");To;;0; [o; ; [I"0Socket.sockaddr_in(80, "www.ruby-lang.org");To;;0; [o; ; [I"$Socket.sockaddr_un("/tmp/sock");T@o; ; [I"=In an AF_INET/AF_INET6 sockaddr array, the 4th element, ;TI"Wnumeric IP address, is used to construct socket address in the Addrinfo instance. ;TI"oIf the 3rd element, textual host name, is non-nil, it is also recorded but used only for Addrinfo#inspect.;T@o; ; [ I"_family is specified as an integer to specify the protocol family such as Socket::PF_INET. ;TI"?It can be a symbol or a string which is the constant name ;TI"Nwith or without PF_ prefix such as :INET, :INET6, :UNIX, "PF_INET", etc. ;TI"&If omitted, PF_UNSPEC is assumed.;T@o; ; [ I"asocktype is specified as an integer to specify the socket type such as Socket::SOCK_STREAM. ;TI"?It can be a symbol or a string which is the constant name ;TI"Uwith or without SOCK_ prefix such as :STREAM, :DGRAM, :RAW, "SOCK_STREAM", etc. ;TI"If omitted, 0 is assumed.;T@o; ; [ I"^protocol is specified as an integer to specify the protocol such as Socket::IPPROTO_TCP. ;TI"8It must be an integer, unlike family and socktype. ;TI"If omitted, 0 is assumed. ;TI"KNote that 0 is reasonable value for most protocols, except raw socket.;T: @fileI"ext/socket/raddrinfo.c;T:0@omit_headings_from_table_of_contents_below0I"üAddrinfo.new(sockaddr) => addrinfo Addrinfo.new(sockaddr, family) => addrinfo Addrinfo.new(sockaddr, family, socktype) => addrinfo Addrinfo.new(sockaddr, family, socktype, protocol) => addrinfo ;T0[I"$(p1, p2 = v2, p3 = v3, p4 = v4);T@`FI" Addrinfo;TcRDoc::NormalClass00