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 Sockets Work?

Answer Posted / chaitanya

The implementation is left up to the vendor of your particular unix, but from the point of view of the programmer, connection-oriented sockets work a lot like files, or pipes. The most noticeable difference, once you have your file descriptor is that read() or write() calls may actually read or write fewer bytes than requested. If this happens, then you will have to make a second call for the rest of the data. There are examples of this in the source code that accompanies the faq.

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 file?

889


What is a socket set used for?

953


Why do we need socket programming?

870


How do I convert a string into an internet address?

1381


Can multiple clients connect to same socket?

904


How many sockets can a port have?

863


What is a socket api?

882


Why does it take so long to detect that the peer died?

1519


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

1363


system choose one for me on the connect() call? Should I bind() a port number in my client program, or let the?

1610


Why do we need sockets?

831


What does af mean in sockets?

925


Why do I get EPROTO from read()?

1449


Is a socket a file?

863


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

865