Hi,
I have a very simple question. I want to test whether a particular port is currently under use or not. For this, I want to bind a TCP socket to the port, if the connection is refused means the port is in use and if not that mean the port is free.
Can someone please tell me how can I write the TCP socket code in C? I am on a solaris platform.
I know its very basic. But I appreciate your help. Thanks in advance.