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

After the chroot(), calls to socket() are failing. Why?

1 Answers  


How come I get address already in use from bind()?

1 Answers  


What is active unix domain sockets?

0 Answers  


How should I choose a port number for my server?

1 Answers  


What is the purpose of socket?

0 Answers  


What is socket programming in java?

0 Answers  


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

0 Answers  


What is a socket api?

0 Answers  


How many sockets can a cpu have?

0 Answers  


How can I read only one character at a time?

1 Answers  


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

0 Answers  


What are the types of sockets?

0 Answers  


Categories