I am writing a simple client/server program which will only run
on Unix boxes (linux, HP-UX, AIX).
By manually choosing the port number,everything works ok.
Whenever I get an "Address in use" i choose a different number.
I want to free clients of this program from having to do this.

From googling around it appears that there is way of the OS, to pick
a free port number. i.e by binding to port 0, sock.bind(('', 0))/ sock.getsockname()[1]

Is there any boost:asio recommended way of doing this ?

Is there any way of completely abstracting out the use of port numbers from an
end users perspective using boost asio ?  i.e so that client/server agree
on a free port number behind the scenes.

Any help appreciated.

  Best regards,
Ta,
   Avi