[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Debian Sparc Perl problem


I've got a problem here with some Perl & I don't know if it's Debian or not.
I can only replicate it on Debian Sparc, but I have no other Linux/Sparc to
test it on. The code works perfectly on Debian i386 & OpenBSD i386.

I've got an app that passes messages to another app on the same machine
using tcp sockets. Using IO::Socket::INET, Blocking reads do not work if I
set a Timeout. Any reads (either <$socket> or $socket->getline) will return
a 'Resource temporarily unavailable' like you'd get if you had no data to
read when you're using non blocking IO (EAGAIN). If I remove the Timeout
parameter, it works as expected.

Code is included below with which I can repeat this on the following

1) Sparc Ultra5 2 x 250Mhz running testing/unstable with perl v5.8.0
2) Sparc E450 4 x 400Mhz running stable with perl v5.6.1
3) Sparc 10 1 x 50Mhz running stable with perl v5.6.1

Suggestions of whats wrong or where I can report this welcome.

Server Code...

use strict;
use POSIX;
use IO::Socket;

my $server = new IO::Socket::INET(
        LocalPort => 12345,
        Listen    => 10,
        Proto     => "tcp",
        Reuse     => 1
) or die "Unable to Bind Socket to Port";

while (my $client = $server->accept()) {
        print "Accepted a new client\n";
        while (<$client>) {
                print "Read $_\n";
                sleep 10;

Client Code...

use strict;
use IO::Socket;

my $ITER = 10;

my $forward_socket = IO::Socket::INET->new(
 Proto => 'tcp',
 PeerAddr => "localhost",
 PeerPort => 12345,
 Timeout => 10,
) or die $!;

for (my $i = 0; $i < $ITER; $i++) {
 print "Sending test $i\n";
 my $resp = $forward_socket->getline
        or print "ERROR $!\n";
 print "Received $resp\n";

Reply to: