The recv() call is normally used only on a connected socket

from recv manual page in unix system( basically recv system call)
but perldoc -f recv says, (perl's recv function)
This call is actually implemented in terms of recvfrom(2) system call. See "UDP: Message Passing" in perlipc for examples.
so you can see man perlipc
I think in this case that server has nothing to give you immediately, you can use MSG_DONTWAIT flag in recv, (on unix systems see man recv for more information on flags to recv). this will make recv to return immediately if no data is available on socket.
Alternatively you can use select function to wait for data to be ready on the socket , if it is ready go and read it using recv. See perldoc -f select or man perlipc


Vivek
-- In accordance with the prarabdha of each, the One whose function it is to ordain makes each to act. What will not happen will never happen, whatever effort one may put forth. And what will happen will not fail to happen, however much one may seek to prevent it. This is certain. The part of wisdom therefore is to stay quiet.

In reply to Re: IO::Socket::INET $Socket->recv won't time out by targetsmart
in thread IO::Socket::INET $Socket->recv won't time out by Grover

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.