Where have you done this? I would have expected something like fcntl(FH, F_SETFL, $flags | O_NONBLOCK) but don't see anything like that. I'd try it out to see if it fixes your problem, but your code doesn't run on my machine ("Bad symbol for filehandle" on the accept($sock[$numsocks], FH) call.)