[Net-z3950] Runtime-error/make test hangs

Anders Sønderberg Mortensen sondberg at indexdata.dk
Fri Aug 16 12:26:12 CEST 2002


Hi guys,

After we upgraded a rh-box to use perl 5.6.0, some problems occured. The 
first thing I noticed was, that when I compile Net::Z3950 with Event-0.80 
or Event-0.86, the make test hangs after the "ok 6" has appeared.
I tried to ignore this, but then later I got this run-time error:

Event: '?? Connection.pm:134' died and then $Event::DIED died with: Can't 
call method "attributes" without a package or object reference at 
/usr/lib/perl5/site_perl/5.6.0/i386-linux/Event.pm line 88.

 at /usr/lib/perl5/site_perl/5.6.0/i386-linux/Net/Z3950/Manager.pm line 
220
Use of uninitialized value in concatenation (.) at 
/usr/lib/perl5/site_perl/5.6.0/i386-linux/Event.pm line 86.

Anyone seen this?

I've attached the package (Multiplex.pm), by which I call the 
Net::Z3950 methods.

--Anders


-----------------------------------------------
Anders Sønderberg Mortensen 
Index Data ApS
Copenhagen, Denmark.

Ph: + 45  33 41 01 05    Fax: + 45  33 41 01 01
-----------------------------------------------  
-------------- next part --------------
package Multiplex;

use strict;
use Net::Z3950;
use Combine;


sub new {
	my ($class, $servers) = @_;
	my $self = {};
	my $server;
	my $connections = {};
	my $mgr = new Net::Z3950::Manager(mode => 'async');

	$self->{CONN} = $connections;
	$self->{MGR} = $mgr;
	bless($self, $class);
	foreach $server (keys %$servers) {
		my $conn = $mgr->connect($server, $servers->{$server}->[0], databaseName => $servers->{$server}->[1]);
		my $check = $mgr->wait();
		unless ($conn eq $check) {
			Combine::CombReport('Wrong connection to server [%s]', $server);
			next;
		}
		unless ($conn->op() == &Net::Z3950::Op::Init) {
			Combine::CombReport('Received wrong respons from server [%s]', $server);
			next;
		}
		$connections->{$server} = $conn;
		Combine::CombReport('Initialized a Z39.50 session on target [%s]', $server);
	}

	return $self;
}


sub search {
	my ($self, $query) = @_;
	my $connections = $self->{CONN};
	my $result = {};
	my ($server, $conn, $op);
	my $mgr = $self->{MGR};
	my $number_of_resp = 0;

	foreach $server (keys %$connections) {
		$connections->{$server}->startSearch($query);
		$number_of_resp++;
	}
	while (($number_of_resp) && ($conn = $mgr->wait())) {
		$number_of_resp--;
		$server = $conn->{host};	## Naughty naughty, not very nice to access host info directly...
		$op = $conn->op();
		if ($op == &Net::Z3950::Op::Error) {
			Combine::CombReport('Search error [%s] on server [%s] ', $conn->addinfo(), $server);
			next;
		} elsif ($op == &Net::Z3950::Op::Search) {
			my $rs = $conn->resultSet();
			$result->{$server} = $rs->size();
		}
	}	 

	return $result;
}

1;



More information about the Net-z3950 mailing list