

Welcome of the web site for the UNIX Socket FAQ! I will be getting back
to updating this site soon, to restore the old links, etc. I'll also
automate the mirroring so new questions go out to the mirror sites.
Please help a friend of mine who is promoting his single by
downloading and listening to
'Notawasaga'. You'll be helping him
to find more listeners, and maybe it'll help soothe your nerves when
your clients and servers just aren't communicating like they should.
You are using a static mirror of the faq, so not all features will be
available to you. The home page that has all the features can be found
at http://www.lcg.org/sock-faq/.
Categorized Questions:
- General Information and Concepts
- What's new?
- About this FAQ
- Who is this FAQ for?
- What are Sockets?
- How do Sockets Work?
- Where can I get source code for the book [book title]?
- Where can I get more information?
- Where can I get the sample source code?
- Questions regarding both Clients and Servers (TCP/SOCK_STREAM)
- How can I tell when a socket is closed on the other end?
- What's with the second parameter in bind()?
- How do I get the port number for a given service?
- If bind() fails, what should I do with the socket descriptor?
- How do I properly close a socket?
- When should I use shutdown()?
- Please explain the TIME_WAIT state.
- Why does it take so long to detect that the peer died?
- What are the pros/cons of select(), non-blocking I/O and SIGIO?
- Why do I get EPROTO from read()?
- How can I force a socket to send the data in its buffer?
- Where can I get a library for programming sockets?
- How come select says there is data, but read returns zero?
- Whats the difference between select() and poll()?
- How do I send [this] over a socket
- How do I use TCP_NODELAY?
- What exactly does the Nagle algorithm do?
- What is the difference between read() and recv()?
- I see that send()/write() can generate SIGPIPE. Is there any advantage to handling the signal, rather than just ignoring it and checking for the EPIPE error?
- After the chroot(), calls to socket() are failing. Why?
- Why do I keep getting EINTR from the socket calls?
- When will my application receive SIGPIPE?
- What are socket exceptions? What is out-of-band data?
- How can I find the full hostname (FQDN) of the system I'm running on?
- Writing Client Applications (TCP/SOCK_STREAM)
- How do I convert a string into an internet address?
- How can my client work through a firewall/proxy server?
- Why does connect() succeed even before my server did an accept()?
- Why do I sometimes lose a server's address when using more than one server?
- How can I set the timeout for the connect() system call?
- Should I bind() a port number in my client program, or let the system choose one for me on the connect() call?
- Why do I get "connection refused" when the server isn't running?
- What does one do when one does not know how much information is comming over the socket? Is there a way to have a dynamic buffer?
- Writing Server Applications (TCP/SOCK_STREAM)
- How come I get "address already in use" from bind()?
- Why don't my sockets close?
- How can I make my server a daemon?
- How can I listen on more than one port at a time?
- What exactly does SO_REUSEADDR do?
- What exactly does SO_LINGER do?
- What exactly does SO_KEEPALIVE do?
- 4.8 How can I bind() to a port number < 1024?
- How do I get my server to find out the client's address / hostname?
- How should I choose a port number for my server?
- What is the difference between SO_REUSEADDR and SO_REUSEPORT?
- How can I write a multi-homed server?
- How can I read only one character at a time?
- I'm trying to exec() a program from my server, and attach my socket's IO to it, but I'm not getting all the data across. Why?
- Writing UDP/SOCK_DGRAM applications
- When should I use UDP instead of TCP?
- What is the difference between "connected" and "unconnected" sockets?
- Does doing a connect() call affect the receive behaviour of the socket?
- How can I read ICMP errors from "connected" UDP sockets?
- How can I be sure that a UDP message is received?
- How can I be sure that UDP messages are received in order?
- How often should I re-transmit un-acknowleged messages?
- How come only the first part of my datagram is getting through?
- Why does the socket's buffer fill up sooner than expected?
- Advanced Socket Programming
- How would I put my socket in non-blocking mode?
- How can I put a timeout on connect()?
Add Your Own Question to the FAQ
| About Me || Recommended Reading |
Contents are copyright by the author of the content. Permission is granted
to do anything you like with this contents so long as you don't claim the
work, or copyright for yourself. Some graphics are copyright© by
www.arttoday.com and used with permission.
Any questions regarding this site should be directed to
vic@acm.org.