If bind() fails, what should I do with the socket descriptor?



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

Post New Answer

More Unix Socket Programming Interview Questions

How do unix sockets work?

0 Answers  


What is the difference between SO_REUSEADDR and SO_REUSEPORT?

0 Answers  


What is difference between socket () and serversocket () class?

0 Answers  


How often should I re-transmit un-acknowleged messages?

1 Answers  


Why do I get connection refused when the server is not running?

1 Answers  






What is with the second parameter in bind()?

1 Answers  


How can I be sure that UDP messages are received in order?

1 Answers  


Why does it take so long to detect that the peer died?

0 Answers  


When will my application receive SIGPIPE?

1 Answers  


How do I send [this] over a socket?

1 Answers  


What is a socket address?

0 Answers  


What's the difference between a socket and a port?

0 Answers  


Categories