good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: Timeout not working while reading from socket.by Athanasius (Archbishop) |
on Jan 24, 2013 at 03:42 UTC ( [id://1015069]=note: print w/replies, xml ) | Need Help?? |
Hello jrtaylor, and welcome to the Monastery! I can’t test your code, as Time::Out doesn’t work on Windows. But I’ve had a go at reducing your script to a minimum example (see How do I post a question effectively?):
As far as I can see, the code within timeout $nbsecs => sub { ... } does nothing but write the same $line to the output file 5 times, flushing the socket each time. Did you mean to put the while loop that reads from the socket into the timeout sub? Hope that helps,
In Section
Seekers of Perl Wisdom
|
|