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 |
What is the difference between read() and recv()?
Why do we need sockets?
How does unix socket work?
of the socket? Does doing a connect() call affect the receive behaviour?
How can I find the full hostname (FQDN) of the system I am running on?
What is with the second parameter in bind()?
How do I send [this] over a socket?
What is Mac, and how is it different from PC? Which one is better for professional users, and why
1 Answers Evolving Systems, IBM,
Are sockets files?
How can I read ICMP errors from connected UDP sockets?
What's better 6pt or 12pt sockets?
Why does connect() succeed even before my server did an accept()?