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.57 by root, Sat Jul 19 22:10:47 2008 UTC vs.
Revision 1.58 by root, Wed Jul 23 22:34:15 2008 UTC

154 154
155If the C<$text> is C<unix/>, then this function returns a special token 155If the C<$text> is C<unix/>, then this function returns a special token
156recognised by the other functions in this module to mean "UNIX domain 156recognised by the other functions in this module to mean "UNIX domain
157socket". 157socket".
158 158
159=item $text = AnyEvent::Socket::aton $ipn
160
161Same as C<parse_address>, but not exported (think C<Socket::inet_aton> but
162I<without> name resolution).
163
159=cut 164=cut
160 165
161sub parse_address($) { 166sub parse_address($) {
162 &parse_ipv4 || &parse_ipv6 || &parse_unix 167 &parse_ipv4 || &parse_ipv6 || &parse_unix
163} 168}
164 169
165*parse_ip =\&parse_address; #d# 170*aton = \&parse_address;
166 171
167=item ($host, $service) = parse_hostport $string[, $default_service] 172=item ($host, $service) = parse_hostport $string[, $default_service]
168 173
169Splitting a string of the form C<hostname:port> is a common 174Splitting a string of the form C<hostname:port> is a common
170problem. Unfortunately, just splitting on the colon makes it hard to 175problem. Unfortunately, just splitting on the colon makes it hard to
265 270
266This function works similarly to C<inet_ntop AF_INET || AF_INET6, ...>, 271This function works similarly to C<inet_ntop AF_INET || AF_INET6, ...>,
267except it automatically detects the address type. 272except it automatically detects the address type.
268 273
269Returns C<undef> if it cannot detect the type. 274Returns C<undef> if it cannot detect the type.
275
276=item $text = AnyEvent::Socket::ntoa $ipn
277
278Same as format_address, but not exported (think C<inet_ntoa>).
270 279
271=cut 280=cut
272 281
273sub format_address; 282sub format_address;
274sub format_address($) { 283sub format_address($) {
308 } else { 317 } else {
309 return undef 318 return undef
310 } 319 }
311} 320}
312 321
313*format_ip = \&format_address; 322*ntoa = \&format_address;
314 323
315=item inet_aton $name_or_address, $cb->(@addresses) 324=item inet_aton $name_or_address, $cb->(@addresses)
316 325
317Works similarly to its Socket counterpart, except that it uses a 326Works similarly to its Socket counterpart, except that it uses a
318callback. Also, if a host has only an IPv6 address, this might be passed 327callback. Also, if a host has only an IPv6 address, this might be passed

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines