Unblocking sockets?

I don't see the point in of unblocking sockets in TCP clients. Using fork() , I create several instances of the program (children) each time I get a new connection. The point of unblocking sockets is that all other sockets aren't blocked when one socket is stuck trying to do something. But why would each socket get stuck if each is running on its on own instance of the program?
So basically, aren't unblocking sockets useless with TCP servers?
Thanks for all help
It depends. If the child process has absolutely nothing else to do other than wait from input from the socket, then no, there is no point to nonblocking I/O. But such a strategy is a trivial Denial of Service attack. I'll just create a client that connects to your server as many times as your server will allow me to. Perhaps you don't limit the number of client connections, in which case I'll run your machine out of memory, file descriptors, or some other resource, causing it to crash. Or if you do limit the number of client connections, I'll just use all of them (and do nothing with them) so nobody else can use your server.
Topic archived. No new replies allowed.