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...

How do I properly close a socket?

Answer Posted / chaitanya

This question is usually asked by people who try close(), because they have seen that that is what they are supposed to do, and then run netstat and see that their socket is still active. Yes, close() is the correct method. To read about the TIME_WAIT state, and why it is important, refer to ``2.7 Please explain the TIME_WAIT state.''.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a socket api?

847


Can a socket have multiple ports?

811


How can I set the timeout for the connect() system call?

1462


What are the pros/cons of select(), non-blocking I/O and SIGIO?

1309


Can multiple sockets use the same port?

817


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

816


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

1559


What is active unix domain sockets?

852


What is af_inet in socket?

777


What does af mean in sockets?

871


How can I write a multi-homed server?

1594


What is a sae socket?

872


What is socket address?

971


Are sockets files?

816


What is the purpose of socket?

847