http://www.perlmonks.org?node_id=384884


in reply to How do I do a non-blocking accept?

you have to set the listening socket to nonblocking, as documented in the man page for accept. This can be done with fcntl rather than setsockopt. As explained above here at How do I do a non-blocking accept?.