How do Sockets Work?
Answer / 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 |
How come I get address already in use from bind()?
What is the difference between a socket and a port?
What's the difference between a socket and a port?
Why do I get EPROTO from read()?
Why do we need socket programming?
What is the difference between close() and shutdown()?
Where is the socket located?
What is Mac, and how is it different from PC? Which one is better for professional users, and why
1 Answers Evolving Systems, IBM,
Why does it take so long to detect that the peer died?
Is a socket a file?
How should I choose a port number for my server?
system choose one for me on the connect() call? Should I bind() a port number in my client program, or let the?