in reply to Re^2: What's the best way to find an unused TCP port on the local system
in thread What's the best way to find an unused TCP port on the local system

portmap is the traditional UNIX RPC way of doing this. It has just one service on a well-known port, which allows you to ask for a service by name and get the port it's currently running on.

It may be overkill for your application, but maybe implementing something simpler with a SOAP interface would work.

  • Comment on Re^3: What's the best way to find an unused TCP port on the local system