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

of the socket? Does doing a connect() call affect the receive behaviour?

1 Answers  


What exactly does SO_LINGER do?

1 Answers  


What is LILO?

2 Answers  


Where is the socket located?

0 Answers  


How can I write a multi-homed server?

0 Answers  






Why do I keep getting EINTR from the socket calls?

1 Answers  


Can a socket have multiple ports?

0 Answers  


Whats the difference between select() and poll()?

0 Answers  


Where can a get a library for programming sockets?

1 Answers  


How can I force a socket to send the data in its buffer?

0 Answers  


How to find other end of unix socket connection?

0 Answers  


Can multiple sockets use the same port?

0 Answers  


Categories