You may use IO::Select before the recv to determine if yoy can read from the socket.
Example:
my $select=new IO::Select(); $select->add($socket); if ($select->can_read($timeout)

In reply to Re: recv in socket programming by weismat
in thread recv in socket programming by madhu.hanigadde

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":