| 1 | #$Id: adc.pm 858 2011-10-10 22:56:04Z pro $ $URL: svn://svn.setun.net/dcppp/trunk/lib/Net/DirectConnect/adc.pm $ | ||
| 2 | # DEPRECATED, NOT USED moving to IO::Socket::IP | ||
| 3 | # | ||
| 4 | # windows: if IO::Socket::IP does not work with ipv6: | ||
| 5 | # upgrade perl to latests | ||
| 6 | # AND reinstall Socket module: | ||
| 7 | # cpan -f -i Socket | ||
| 8 | # | ||
| 9 | package #hide from cpan | ||
| 10 | Net::DirectConnect::ipv6; | ||
| 11 | use strict; | ||
| 12 | no strict qw(refs); | ||
| 13 | use warnings "NONFATAL" => "all"; | ||
| 14 | no warnings qw(uninitialized); | ||
| 15 | no if $] >= 5.017011, warnings => 'experimental::smartmatch'; | ||
| 16 | #use Time::HiRes qw(time sleep); | ||
| 17 | #use Socket; | ||
| 18 | #Net::DirectConnect::use_try 'Socket6' if $] < 5.014; | ||
| 19 | # if $] < 5.014; | ||
| 20 | #require IO::Socket::IP if $] >= 5.014 | ||
| 21 | use Data::Dumper; #dev only | ||
| 22 | #$Data::Dumper::Sortkeys = $Data::Dumper::Useqq = $Data::Dumper::Indent = 1; | ||
| 23 | sub init { | ||
| 24 | my $self = shift if ref $_[0]; | ||
| 25 | $self->{'socket_class'} = 'IO::Socket::INET6' | ||
| 26 | if $^O eq 'MSWin32' and Net::DirectConnect::use_try 'IO::Socket::INET6'; # if $] < 5.014; | ||
| 27 | #$self->{'socket_options'}{Domain} = AF_INET6; | ||
| 28 | } | ||
| 29 | 6; |