ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent/lib/AnyEvent/Socket.pm
(Generate patch)

Comparing AnyEvent/lib/AnyEvent/Socket.pm (file contents):
Revision 1.11 by root, Fri May 23 20:09:56 2008 UTC vs.
Revision 1.12 by root, Fri May 23 20:13:57 2008 UTC

73 73
74Tries to parse the given IPv6 address and return it in 74Tries to parse the given IPv6 address and return it in
75octet form (or undef when it isn't in a parsable format). 75octet form (or undef when it isn't in a parsable format).
76 76
77Should support all forms specified by RFC 2373 (and additionally all IPv4 77Should support all forms specified by RFC 2373 (and additionally all IPv4
78formst supported by parse_ipv4). 78forms supported by parse_ipv4).
79
80This function works similarly to C<inet_pton AF_INET6, ...>.
79 81
80=cut 82=cut
81 83
82sub parse_ipv6($) { 84sub parse_ipv6($) {
83 # quick test to avoid longer processing 85 # quick test to avoid longer processing
128 130
129=item $text = format_ip $ipn 131=item $text = format_ip $ipn
130 132
131Takes either an IPv4 address (4 octets) or and IPv6 address (16 octets) 133Takes either an IPv4 address (4 octets) or and IPv6 address (16 octets)
132and converts it into textual form. 134and converts it into textual form.
135
136This function works similarly to C<inet_ntop AF_INET || AF_INET6, ...>,
137except it automatically detects the address type.
133 138
134=cut 139=cut
135 140
136sub format_ip; 141sub format_ip;
137sub format_ip($) { 142sub format_ip($) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines