X-Git-Url: http://git.rot13.org/?p=virtual-ldap;a=blobdiff_plain;f=bin%2Fldap-koha.pl;h=e9ed1f997f5eedaed6ab9bf480741975a87a4440;hp=40c64d651255c65f376e36383d31b1f4688fae0d;hb=495fb580ea5f2cb6e48eb2f1b10392b3f00125e9;hpb=fc93087a8d0925aaab323e7d9a2f38be6a962992 diff --git a/bin/ldap-koha.pl b/bin/ldap-koha.pl index 40c64d6..e9ed1f9 100755 --- a/bin/ldap-koha.pl +++ b/bin/ldap-koha.pl @@ -8,14 +8,14 @@ use IO::Socket; use lib 'lib'; use LDAP::Koha; -my $listen = '10.60.0.13:2389'; +my $listen = shift @ARGV || 'localhost:2389'; my $sock = IO::Socket::INET->new( Listen => 5, Proto => 'tcp', Reuse => 1, LocalAddr => $listen, -) || die; +) || die "can't listen to $listen $!"; warn "# listening on $listen"; @@ -26,6 +26,7 @@ while (my @ready = $sel->can_read) { if ($fh == $sock) { # let's create a new socket my $psock = $sock->accept; + $psock->sockopt(SO_KEEPALIVE,1); $sel->add($psock); $Handlers{*$psock} = LDAP::Koha->new($psock); } else {