Adam Leventhal wrote:
I'm writing a program that needs to accept network connections, but the
actual port number doesn't matter, and I'd like the kernel (or someone) to
choose an available port for me. Does this functionality exist?

Thanks.

Adam

(Darren Moffat: this _is_ the problem I'm actually trying to solve)


Try binding to port 0; the system will pick a free one.

http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/stand/lib/tcp/tcp.c#1205

- Bart

--
Bart Smaalders                  Solaris Kernel Performance
[EMAIL PROTECTED]               http://blogs.sun.com/barts
_______________________________________________
networking-discuss mailing list
[email protected]

Reply via email to