If bind() fails, what should I do with the socket descriptor?
Answer / chaitanya
If you are exiting, I have been assured by Andrew that all unixes will close open file descriptors on exit. If you are not exiting though, you can just close it with a regular close() call.
| Is This Answer Correct ? | 1 Yes | 0 No |
How do I get my server to find out the clients address / host- name?
What exactly does SO_REUSEADDR do?
When will my application receive SIGPIPE?
system choose one for me on the connect() call? Should I bind() a port number in my client program, or let the?
What is LILO?
What are raw sockets?
How do I get the port number for a given service?
How are unix domain sockets implemented?
Why does connect() succeed even before my server did an accept()?
Is socket a hardware or software?
How does a socket work?
How many sockets can a cpu have?