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 23, 2015 21:33
Subject:
Re: Communicating between processes in test suite run
Message ID:
55396509.6070204@opera.com
Il 23/04/2015 21:53, Tim Bunce ha scritto:

>>> How is "the port number is saved into the file" when you don't know
>>> which port it has bound itself to?
>>
>> The daemon starts and binds using port 0. Still within the daemon code,
>> I can then query for the used port, through regular socket calls.
>> After that, I check for HARNESS_ACTIVE and STATSD_PORT_FILE
>> and I write the port to the file indicated by STATSD_PORT_FILE.
>>
>> Of course I don't like that the statsd daemon code needs to know about
>> this at all.
>
> 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.

Correct. That would be an argument in favour of avoiding port zero,
and providing the daemon binary with a dynamic configuration,
so the port is chosen before-hand by the test "client".

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