in reply to IO::Socket to recv

for a networking app you would probably want to create your sockets as non-blocking and use the select() builtin to determine when data is available for reading or the timeout has expired.