Unix Socket Programming Question:

Download Job Interview Questions and Answers PDF

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

Unix Socket Programming Interview Question
Unix Socket Programming Interview Question

Answer:

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.

Download Unix Socket Programming Interview Questions And Answers PDF

Previous QuestionNext Question
What is with the second parameter in bind()?When should I use shutdown()?