From 0a86c4341dfe313546f605c32959810cbf5bc288 Mon Sep 17 00:00:00 2001 From: minima Date: Fri, 11 Jan 2002 00:30:15 +0000 Subject: [PATCH] try to get around differences for TCP_NODELAY for perl 5_005 and below --- perl/Msg.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/perl/Msg.pm b/perl/Msg.pm index 5593e937..57880ed1 100644 --- a/perl/Msg.pm +++ b/perl/Msg.pm @@ -375,7 +375,11 @@ sub new_server { return $self; } -use Socket qw(IPPROTO_TCP TCP_NODELAY); +eval "use Socket qw(IPPROTO_TCP TCP_NODELAY)"; +if ($@) { + sub IPPROTO_TCP {6;} + sub TCP_NODELAY {1;}; +} sub nolinger { @@ -390,7 +394,7 @@ sub nolinger 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: $!"; - setsockopt($conn->{sock}, IPPROTO_TCP, TCP_NODELAY, 1) or confess "setsockopt: $!"; + setsockopt($conn->{sock}, IPPROTO_TCP, TCP_NODELAY, 1) or confess "setsockopt: $!" unless $main::iswin; $conn->{sock}->autoflush(0); if (isdbg('sock')) { -- 2.43.0