Re: Communicating between processes in test suite run
[email protected] (Cosimo Streppone) Thu, 23 Apr 2015 23:32:57 +0200
| Newsgroups | perl.qa |
|---|---|
| Message-ID | <[email protected]> |
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