On Apr 3, 2013, at 11:58 , Quanah Gibson-Mount <qua...@zimbra.com> wrote:
> --On Friday, March 29, 2013 7:14 PM +0100 Peter Marschall <pe...@adpm.de> > wrote: > >> Hi Quanah, >> >> On Friday, 29. March 2013, Quanah Gibson-Mount wrote: >>> Do you have plans to add the linux TCP keepalive bits I noted in a future >>> release? >> >> I am very much in doubt about the Linux specific TCP keepalive bits. >> I'd rather keep perl-ldap independent of specific OS peculiarities. >> >> Net::LDAP exposes the socket it uses via the socket() method. >> Can't this be used to implement the things on the application side? > > Hi Peter, > > In doubt about what exactly? If you look at the patch I wrote, it does > nothing unless the related perl module is installed. Any application that > used Net::LDAP (such as Amavis) can then trivially set the parameters in its > setup block for Net::LDAP, and it will work without error on any system, > regardless of whether or not the enhanced keepalive bits are available. In > fact, that's exactly what I patched amavis to do: > > my $ldap = Net::LDAP->new($self->{hostname}, > localaddr => $self->{localaddr}, > port => $self->{port}, > scheme => $self->{scheme}, > version => $self->{version}, > timeout => $self->{timeout}, > keepalive => 1, > keepalive_idle => 240, > keepalive_interval => 30, > keepalive_probe => 10, > ); > > This allows amavis to set keepalive on any platform. If the platform doesn't > support the enhanced directives, Net::LDAP just ignores them. It allows for > future expansion if/when other platforms add support for the enhanced > keepalive directives and someone adds a perl module for it ( OSX has some but > not all last I checked). but keepalive is not inherently part of LDAP any more than it is part of SMTP or FTP or any other protocol. But this implementation gives the impression that it is and may surprised someone when it silently does not do what is expected because of the host they ran it on. > I.e., it doesn't in any way make Net::LDAP platform specific, No, it adds non-ldap specific implementaiton > but it allows enhanced functionality if it is supported on the platform in a > way that application authors can trivially add it to their existing code, > keeping it clearly organized in their Net::LDAP instantiation blocks. I agree with Peter's comment that it is better, IMO, for an application that cares about this to do so by using the $ldap->socket to get the socket. Graham.