[Spread-users] connect error after disconnect
Yuval Lifshitz
ylifshitz at cablematrix.com
Sun May 15 03:49:26 EDT 2005
Ilya,
I use C interface, but I had similar problem when spread.conf had some
problems (I think it did not matched /etc/hosts).
In addition you might want to check the returned value from "disconnect".
And as a very last option, calling "rm -f /tmp/4803" as root will do the
work (in a very ugly way).
Yuval.
-----Original Message-----
From: spread-users-bounces at lists.spread.org
[mailto:spread-users-bounces at lists.spread.org] On Behalf Of Ilya Zaytsev
Sent: ה 12 מאי 2005 02:02
To: spread-users at lists.spread.org
Subject: [Spread-users] connect error after disconnect
Hi,
I have a special case environment, sometime I need to disconnect from spread
and connect again from the same process and with the same private name, and
experienced not regular the 'Not Unique' error.
This is a perl script to reproduce this situation and output is below.
--------------------------------------- the script #!/usr/local/bin/perl -w
use strict;
use Spread qw(:SP :MESS :ERROR);
use vars qw($i);
my $ii;
for ($ii=0;$ii<1000;$ii++)
{
doio();
}
sub doio{
my $pidgroup = 'P'.getppid();
my $msg;
my %args;
my $privategroup;
my $spmbox;
$i++;
$args{'spread_name'} = '4803';
$args{'private_name'} = $pidgroup;
$args{'priority'} = 0;
$args{'group_membership'} = 0;
($spmbox, $privategroup) = Spread::connect(\%args);
if (!defined($spmbox))
{
print "SP CONNECT ERROR: ".$pidgroup." $sperrno\r\n";
return;
}
$msg ='TEST MSG #'.$i.' '.$pidgroup."\r\n";
if (!(Spread::multicast($spmbox,SAFE_MESS,'TEST', 0, $msg)))
{
print "SP SEND ERROR:$sperrno\r\n";
}
else {
print $msg;
}
Spread::disconnect($spmbox);
undef $spmbox;
}
--------------------------------------- the script output ...
SP CONNECT ERROR: P43117 Reject: Not Unique TEST MSG #282 P43117 SP CONNECT
ERROR: P43117 Reject: Not Unique TEST MSG #284 P43117 SP CONNECT ERROR:
P43117 Reject: Not Unique TEST MSG #286 P43117 TEST MSG #287 P43117 TEST MSG
#288 P43117 TEST MSG #289 P43117 ..
--
Best regards,
Ilya Zaytsev
_______________________________________________
Spread-users mailing list
Spread-users at lists.spread.org
http://lists.spread.org/mailman/listinfo/spread-users
More information about the Spread-users
mailing list