use SO_KEEPALIVE to detect hanging connections
authorDobrica Pavlinusic <dpavlin@rot13.org>
Fri, 20 May 2011 12:00:03 +0000 (12:00 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Fri, 20 May 2011 12:00:03 +0000 (12:00 +0000)
bin/ldap-koha.pl

index e97e1ef..e9ed1f9 100755 (executable)
@@ -26,6 +26,7 @@ while (my @ready = $sel->can_read) {
                if ($fh == $sock) {
                        # let's create a new socket
                        my $psock = $sock->accept;
                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 {
                        $sel->add($psock);
                        $Handlers{*$psock} = LDAP::Koha->new($psock);
                } else {