Is there an API function on Linux (kernel 2.6.20) which can be used to check if a given TCP/IP port is used - bound and/or connected ?
Is bind()
the only solution (binding to the given port using a socket with the SO_REUSEADDR
option, and then closing it) ?