Re: WIN32::PIPE bug ?
- From: "Sisyphus" <sisyphus1@xxxxxxxxxxxxxxxxx>
- Date: Thu, 15 Jun 2006 16:33:39 +1000
"karl zero" <karl_zero@xxxxxxxx> wrote in message
news:2O5kg.36525$G97.713505@xxxxxxxxxxxxxxxxxxxxxx
Sisyphus wrote:usage.
Sounds like it. Can you post some *minimal* server and client code that
demonstrates the problem ? ... preferably so that the server and client
script run on the same machine.
see below, made of the example from roth's website and slightly modified
with an infinite loop
run the server, then the client and look at the server process memory
Yes - I now see the mistake I made in the code I had tried - one should do a
$Pipe->Read() if and only if $Pipe->Connect() returns true.
However, using the scripts you supplied (below) I don't get any memory
leaks. I let it run for a couple of minutes and memory usage remained
constant. If there's a leak there on my machine it must be a very slow one.
I inserted a 'print $$' into the 2 scripts so that I knew what their
repective PID's were, and kept an eye on the memory usage for both of those
PID's on Task Manager's 'Processes' page. I also kept an eye on the total
memory usage (which is visible at the bottom of the Task Manager window, no
matter which page you happen to be on). Everything remained constant -
though the total memory usage fluctuated a little from time to time. I
didn't see anything untoward.
What version of perl are you using ?
If you're running ActiveState perl, which build ?
Which version of Win32::Pipe are you running ?
I'm running perl 5.8.8, AS build 817, Win32:Pipe-0.22:
E:\>perl -e "print $ActivePerl::VERSION"
817
E:\>perl -MWin32::Pipe -e "print $Win32::Pipe::VERSION"
0.022
E:\>
Cheers,
Rob
"\n";
server:
#!/usr/bin/perl -w
use Win32::Pipe;
$PipeName = "test";
$| = 1;
print "Creating pipe \"$PipeName\".\n";
if( $Pipe = new Win32::Pipe( $PipeName ) )
{
print "Waiting for a client to connect...\n";
if( $Pipe->Connect() )
{
my $In;
while ($In = $Pipe->Read()) {
print "Client sent us: ".$In."";
}
$Pipe->Disconnect();
}
$Pipe->Close();
}
client:
use Win32::Pipe;
$PipeName = "\\\\.\\pipe\\test";
print "Connecting to $PipeName\n";
if( $Pipe = new Win32::Pipe( $PipeName ) )
{
print "\nPipe has been opened, writing data to it...\n";
my $Data;
while (1) {
$Data = "Time on " . Win32::NodeName() . " is: " . localtime() .
$Pipe->Write( $Data );
}
$Pipe->Close();
}
.
- Follow-Ups:
- Re: WIN32::PIPE bug ?
- From: karl zero
- Re: WIN32::PIPE bug ?
- References:
- WIN32::PIPE bug ?
- From: karl zero
- Re: WIN32::PIPE bug ?
- From: Sisyphus
- Re: WIN32::PIPE bug ?
- From: karl zero
- WIN32::PIPE bug ?
- Prev by Date: Re: WIN32::PIPE bug ?
- Next by Date: Did not return a true value
- Previous by thread: Re: WIN32::PIPE bug ?
- Next by thread: Re: WIN32::PIPE bug ?
- Index(es):
Relevant Pages
|
Loading