Re: WIN32::PIPE bug ?




"karl zero" <karl_zero@xxxxxxxx> wrote in message
news:2O5kg.36525$G97.713505@xxxxxxxxxxxxxxxxxxxxxx
Sisyphus wrote:

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
usage.


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


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() .
"\n";
$Pipe->Write( $Data );
}
$Pipe->Close();
}



.



Relevant Pages

  • Re: Smart Navigation property causing infinite Page Reload (v 1.1)
    ... I suspect the client side code generate by the SmartNavigation script. ... being processed on the web server. ... Permission to scripts and Executables for your defaultl Home. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Javascript on steroids!
    ... third party inject scripts on the client is sufficiently risky to ... server could be used to inject arbitrary malicious scripts in a way that ... scripts injected on the client is anything that can be done by any ...
    (comp.lang.javascript)
  • Re: middleware, so to speak
    ... > scripts has to send off to another server (hence the middleware ... > comment) and wait for a response. ... > client. ... > external server. ...
    (comp.lang.perl)
  • Re: SLP & client cannot be matched to any site boundaries
    ... they are not the same scripts. ... >http:// SERVER NAME>/SMS_SLP/slp.dll?site&ad=<AD SITE ... >> are listed in SMS and that the client is within those ... >> boundaries. ...
    (microsoft.public.sms.admin)
  • Re: Consuming less memory when writing a file?
    ... > I am using Response.WriteFile (filename) to write a file that on ... > the server to my web client. ... > for example, a 14m-bytes one, the memory usage of the ...
    (microsoft.public.dotnet.framework.aspnet)

Loading