--- loncom/LondConnection.pm 2003/07/02 01:12:35 1.7 +++ loncom/LondConnection.pm 2003/08/03 00:45:54 1.8 @@ -1,7 +1,7 @@ # This module defines and implements a class that represents # a connection to a lond daemon. # -# $Id: LondConnection.pm,v 1.7 2003/07/02 01:12:35 foxr Exp $ +# $Id: LondConnection.pm,v 1.8 2003/08/03 00:45:54 foxr Exp $ # # Copyright Michigan State University Board of Trustees # @@ -153,7 +153,8 @@ sub new { unless ($self->{Socket} = IO::Socket::INET->new(PeerHost => $self->{Host}, PeerPort => $self->{Port}, Type => SOCK_STREAM, - Proto => "tcp")) { + Proto => "tcp", + Timeout => 5)) { return undef; # Inidicates the socket could not be made. } # @@ -215,11 +216,10 @@ sub Readable { my $rv = $socket->recv($data, POSIX::BUFSIZ, 0); my $errno = $! + 0; # Force numeric context. - unless (defined($rv) && (length($data)> 0)) {# Read failed, + unless (defined($rv) && length $data) {# Read failed, if(($errno == POSIX::EWOULDBLOCK) || ($errno == POSIX::EAGAIN) || - ($errno == POSIX::EINTR) || - ($errno == 0)) { + ($errno == POSIX::EINTR)) { return 0; }