Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


What is the difference between close() and shutdown()?



What is the difference between close() and shutdown()?..

Answer / chaitanya

Generally the difference between close() and shutdown() is: close() closes the socket id for the process but the connection is still opened if another process shares this socket id. The connection stays opened both for read and write, and sometimes this is very important. shutdown() breaks the connection for all processes sharing the socket id. Those who try to read will detect EOF, and those who try to write will reseive SIGPIPE, possibly delayed while the kernel socket buffer will be filled. Additionally, shutdown() has a second argument which denotes how to close the connection: 0 means to disable further reading, 1 to disable writing and 2 disables both.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Unix Socket Programming Interview Questions

What is the function of socket?

0 Answers  


What is the difference between read() and recv()?

0 Answers  


Why do we need socket programming?

0 Answers  


What exactly does SO_LINGER do?

1 Answers  


What is Mac, and how is it different from PC? Which one is better for professional users, and why

1 Answers   Evolving Systems, IBM,


What is a deep well socket?

0 Answers  


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

0 Answers  


How can I find the full hostname (FQDN) of the system I am running on?

1 Answers  


Can a single socket port be used for multiple applications?

0 Answers  


over the socket? Is there a way to have a dynamic buffer? What does one do when one does not know how much information is coming?

1 Answers  


When should I use UDP instead of TCP?

1 Answers  


What's better 6pt or 12pt sockets?

0 Answers  


Categories