Why not just do bind(0) and report which port was bound?
/ Fredrik (Naranek) Hubinette (Real Build Master)
Previous text:
2003-04-15 23:48: Subject: Starting new pike processes from the testsuite
The test will fail, I guess.
If that's a problem, one could hack the server program to try random ports until bind succeeds, and then write the port number to stdout.
/ Niels Möller (ny flexiblare bröstkorg)