On May 28, 2007, at 12:33 PM, Peter Marschall wrote:
That is encouraging. However, I am not sure I like how
IO::Socket::SSL
switches between v4 and v6. It uses arguments passed to import to
change
@ISA. Which means @ISA can change from INET to INET6 or back at
runtime.
I do not like the interface either.
Do you have any idea about changing the interface of IO::Socket::SSL
with regard to inet4/inet6 so that we can contact the maintainer
with something sensible.
Well they suffer from the same problem that Net::FTP etc has. That is
that they inherit from the socket.
The best thing would be to have two separate classes. One for ::INET
and one for ::INET6 and have IO::Socket::SSL bless into the correct
one instead of changing what IO::Socket::SSL is. As it is it is
impossible to have 2 connections in the same program where one uses
inet and one uses inet6
I did think about trying to clone things with something like
package Net::LDAP::SSL;
require IO::Socket::SSL;
foreach my $sym (keys %IO::Socket::SSL::) {
if (defined &{"IO::Socket::SSL::$sym"}) {
*{$sym} = \&{"IO::Socket::SSL::$sym"};
}
}
package Net::LDAP::SSL::INET;
@ISA = qw(Net::LDAP::SSL IO::Socket::INET);
package Net::LDAP::SSL::INET6;
@ISA = qw(Net::LDAP::SSL IO::Socket::INET6);
BTW. I do not like the inet => 1 option for Net::LDAP->new() very
much. If anybody has an idea of making it better
(e.g. to allow distinction between AF_INET, AF_INET6 and AF_UNSPEC)
I do not like it either. Using AF_UNSPEC should be safe though. If
this does work I would consider making INET6 and AF_UNSPEC the
default, when INET6 is available. It should still connect to a IPv4
host just fine. But we can have inet4 and inet6 options to force it.
Graham.