From fed23e959f913570cfde56d06ef8590bee37c3d4 Mon Sep 17 00:00:00 2001 From: minima Date: Fri, 11 Jan 2002 15:11:36 +0000 Subject: [PATCH] move more M$ stuff out from nolinger --- perl/Msg.pm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/perl/Msg.pm b/perl/Msg.pm index f6164132..8cf36701 100644 --- a/perl/Msg.pm +++ b/perl/Msg.pm @@ -400,20 +400,20 @@ sub nolinger my $n = $main::is_win ? 0 : unpack "l", getsockopt($conn->{sock}, IPPROTO_TCP, TCP_NODELAY); dbg("Linger is: $l $t, keepalive: $k, nagle: $n"); } - - setsockopt($conn->{sock}, SOL_SOCKET, SO_LINGER, pack("ll", 0, 0)) or confess "setsockopt linger: $!"; + setsockopt($conn->{sock}, SOL_SOCKET, SO_KEEPALIVE, 1) or confess "setsockopt keepalive: $!"; unless ($main::is_win) { + setsockopt($conn->{sock}, SOL_SOCKET, SO_LINGER, pack("ll", 0, 0)) or confess "setsockopt linger: $!"; setsockopt($conn->{sock}, IPPROTO_TCP, TCP_NODELAY, 1) or confess "setsockopt: $!"; - } - $conn->{sock}->autoflush(0); - + } if (isdbg('sock')) { my ($l, $t) = unpack "ll", getsockopt($conn->{sock}, SOL_SOCKET, SO_LINGER); my $k = unpack 'l', getsockopt($conn->{sock}, SOL_SOCKET, SO_KEEPALIVE); my $n = $main::is_win ? 0 : unpack "l", getsockopt($conn->{sock}, IPPROTO_TCP, TCP_NODELAY); dbg("Linger is: $l $t, keepalive: $k, nagle: $n"); - } + + } + $conn->{sock}->autoflush(0); } sub dequeue -- 2.43.0