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 can I read ICMP errors from connected UDP sockets?
Can a single socket port be used for multiple applications?
What is the difference between connected and unconnected sockets?
How can I be sure that UDP messages are received in order?
Is there any advantage to handling the signal, rather than just ignoring it and checking for the EPIPE error? Are there any useful parameters passed to the signal catching function?
How can I write a multi-homed server?
What exactly does SO_LINGER do?
How come I get address already in use from bind()?
How come only the first part of my datagram is getting through?
Why do we need sockets?
What are the pros/cons of select(), non-blocking I/O and SIGIO?
How come select says there is data, but read returns zero?