in reply to Re: Re: Re: Shared.pm
in thread Shared.pm

Thats exactly what it does. The Shared::Local object doesn't know where to send the data until a Shared::Retriever connects to it; the Shared::Local connects to send to Shared::Retriever on the same port that the retriever sent the data on, and the retriever listens on the same port it sent the data on. (It closes the port first, of course). This allows support of multiple retrievers able to connect to one Shared::Local.

I think I am going to add a "debug" switch (at least for now), that will spew out all sorts of data when turned on. Hopefully, this'll help sort out just where exactly you are having the problem.

Replies are listed 'Best First'.
Re(5) More testing with Shared.pm
by lestrrat (Deacon) on Dec 08, 2001 at 13:17 UTC

    Sorry for the delay. I tried the same thing with Perl 5.6, RedHat Linux 7.1. After I saw that something wasn't working, I changed the lines

    sub send_data { my ($self, $connection) = @_; my $address = eval{$$connection->peerhost}; my $port = eval{$$connection->peerport}; $$connection->close; my $sock = IO::Socket::INET->new( Proto => 'tcp', PeerAddr => $address, PeerPort => $port ) or Carp::confess $@; # <- this +used to be die $! $sock->autoflush(1); syswrite($sock, $self->{data}, length($self->{data})); $sock->close; }

    And get the following error :

    IO::Socket::INET: Timeout at Shared.pm line 251 Shared::Local::send_data('HASH(0x812e004)', 'SCALAR(0x821e260)') c +alled at Shared.pm line 233 Shared::Local::new('Shared::Local', 'name', 'new_shared', 'accept' +, 'ARRAY(0x812decc)') called at test.pl line 5 at Shared.pm line 394 Shared::Retriever::retrieve('Shared::Retriever=HASH(0x80f7acc)', ' +Shared::Local=HASH(0x812e004)') called at test.pl line 12 [me@myhost me]$

    while $@ contains "timeout", I'm not sure if it's being able to find the Server Socket opened by the Retriever. This also left a zombie process in the background.