After I run an accept I want to come out after 3 seconds. Now I need something like a timeout for accept. My code: $newchecksock=$checksock->accept(); while (defined($buf=<$newchecksock> )) { chomp($buf); if($buf eq "ok") { print"everything's ok, Port $portonclient[$i] is open!\n"; } }

How can I create a timeout for this ? Please help ! Thanks a lot, Holger.