X-Git-Url: http://www.dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FMsg.pm;h=c9b58a482cb19398d9e94cc3cf471e3f69bb801d;hb=e1d5c2a325cb6b8674eab55c23f12445aae01f52;hp=a485718cd155bda80b42eab44cd140f1a66ff00b;hpb=09cf2338daaf67c2844b5d0894b78636c9ab6102;p=spider.git diff --git a/perl/Msg.pm b/perl/Msg.pm index a485718c..c9b58a48 100644 --- a/perl/Msg.pm +++ b/perl/Msg.pm @@ -84,8 +84,8 @@ BEGIN { eval '*EWOULDBLOCK = *EAGAIN = sub { 10035 };' unless defined *EWOULDBLOCK; eval '*F_GETFL = sub { 0 };' unless defined *F_GETFL; eval '*F_SETFL = sub { 0 };' unless defined *F_SETFL; - eval '*IPPROTO_TCP = sub { 6 };' unless defined *IPPROTO_TCP; - eval '*TCP_NODELAY = sub { 1 };' unless defined *TCP_NODELAY; + eval 'sub IPPROTO_TCP { 6 };'; + eval 'sub TCP_NODELAY { 1 };'; $blocking_supported = 0; # it appears that this DOESN'T work :-( } } @@ -193,6 +193,12 @@ sub pid_gone } } +sub peerhost +{ + my $self = shift; + return $self->{peerhost}; +} + #----------------------------------------------------------------- # Send side routines sub connect { @@ -225,7 +231,8 @@ sub connect { return undef unless $r || _err_will_block($!); $conn->{sock} = $sock; - + $conn->{peerhost} = $sock->peerhost; # for consistency + if ($conn->{rproc}) { my $callback = sub {$conn->_rcv}; set_event_handler ($sock, read => $callback);