http://qs321.pair.com?node_id=184679

gmpassos has asked for the wisdom of the Perl Monks concerning the following question: (network programming)

Let's say that a server socket need to read the data sent by the client, but the client is not sending any data. In this case the server will be trying to read indefinitely. In other words, the server app will be stoped in the same command indefinitely. To prevent this we need to check if the socket has data to read first, if the client already have sent the data, and only after this read the socket. What is the best way to do this? (without threads)

Originally posted as a Categorized Question.