… | |
… | |
1033 | To understand the usefulness of this function, consider a function that |
1033 | To understand the usefulness of this function, consider a function that |
1034 | asynchronously does something for you and returns some transaction |
1034 | asynchronously does something for you and returns some transaction |
1035 | object or guard to let you cancel the operation. For example, |
1035 | object or guard to let you cancel the operation. For example, |
1036 | C<AnyEvent::Socket::tcp_connect>: |
1036 | C<AnyEvent::Socket::tcp_connect>: |
1037 | |
1037 | |
1038 | # start a conenction attempt unless one is active |
1038 | # start a connection attempt unless one is active |
1039 | $self->{connect_guard} ||= AnyEvent::Socket::tcp_connect "www.example.net", 80, sub { |
1039 | $self->{connect_guard} ||= AnyEvent::Socket::tcp_connect "www.example.net", 80, sub { |
1040 | delete $self->{connect_guard}; |
1040 | delete $self->{connect_guard}; |
1041 | ... |
1041 | ... |
1042 | }; |
1042 | }; |
1043 | |
1043 | |
… | |
… | |
2210 | used, and preference will be given to protocols mentioned earlier in the |
2210 | used, and preference will be given to protocols mentioned earlier in the |
2211 | list. |
2211 | list. |
2212 | |
2212 | |
2213 | This variable can effectively be used for denial-of-service attacks |
2213 | This variable can effectively be used for denial-of-service attacks |
2214 | against local programs (e.g. when setuid), although the impact is likely |
2214 | against local programs (e.g. when setuid), although the impact is likely |
2215 | small, as the program has to handle conenction and other failures anyways. |
2215 | small, as the program has to handle connection and other failures anyways. |
2216 | |
2216 | |
2217 | Examples: C<PERL_ANYEVENT_PROTOCOLS=ipv4,ipv6> - prefer IPv4 over IPv6, |
2217 | Examples: C<PERL_ANYEVENT_PROTOCOLS=ipv4,ipv6> - prefer IPv4 over IPv6, |
2218 | but support both and try to use both. C<PERL_ANYEVENT_PROTOCOLS=ipv4> |
2218 | but support both and try to use both. C<PERL_ANYEVENT_PROTOCOLS=ipv4> |
2219 | - only support IPv4, never try to resolve or contact IPv6 |
2219 | - only support IPv4, never try to resolve or contact IPv6 |
2220 | addresses. C<PERL_ANYEVENT_PROTOCOLS=ipv6,ipv4> support either IPv4 or |
2220 | addresses. C<PERL_ANYEVENT_PROTOCOLS=ipv6,ipv4> support either IPv4 or |