develooper Front page | perl.qa | Postings from April 2015

Re: Communicating between processes in test suite run

Thread Previous | Thread Next
From:
Cosimo Streppone
Date:
April 25, 2015 19:19
Subject:
Re: Communicating between processes in test suite run
Message ID:
553BE8A4.9030704@opera.com
Il 24/04/2015 18:12, Michael Kiwala ha scritto:
> On Thu, Apr 23, 2015 at 2:53 PM, Tim Bunce <Tim.Bunce@pobox.com
> <mailto:Tim.Bunce@pobox.com>> wrote:
>
>     That approach only applies to your perl statsd, right?  For the nodejs
>     or C statsd's you don't have an easy[*] a way to find the port.
>
> I was about to suggest running `lsof -i -sTCP:LISTEN -p $PID_OF_STATSD`
> in the parent after the server has been spawned, when I noticed that Tim
> already mentioned the lsof option in his footnote.
>
> Why not use lsof to query the port that was assigned?

I'm often a bit reluctant to use system commands as that
makes the whole process more OS dependent.

Even considering Win32 out of the picture, is lsof working
in the same way for every OS where perl is running?

I guess that is my only argument against it, but thanks for
suggesting it, it's certainly a valid strategy.

-- 
Cosimo


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About