Unix Socket Programming Question:
Download Questions PDF

How do Sockets Work?

Answer:

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.

Download Unix Socket Programming Interview Questions And Answers PDF

Previous QuestionNext Question
What are raw sockets?What is with the second parameter in bind()?