bind returns error when a port is already in use ....some process may
be using it or the port may be just port is not used still it is
hanging around kernel...
how can i kinow the difference between these ????
I don't understand the second description, but if bind() returns -1 for
failure, you can see what went wrong by examining errno. For example,
errno will be set to EADDRINUSE if the given address is already in use.
By the way, your questions are 100% topical, and you'd do well to ignore
the cantankerous few who insist otherwise.
Ask yourself the following questions:
1) Out of the people who've whined about "topicality", how many of them
have given you a useful answer to any of your questions?
2) Given 1), do you think you've got anything to gain by giving in to
their childish clamoring?
Help keep this group healthy with more good C questions!