Hello!

my first post :) The challange I have is getting recv (in IO::Socket) to not hang.

I send a query (a SELECT) to mysql (5.0.22) through the NET::MySql module and it hangs where the table is empty. Specifically it hangs on the 2nd call to recv on the line

${*$sock}{'io_socket_peername'} = recv($sock, $_[1]='', $len, $flags);

I can't get the debuger to step into this line, it just hangs. I've tried different timeouts and specifying non-blocking. With a non-blocking socket, whatever the timeout, server authentication always fails immediately, claiming a timeout. (I've checked the socket timeout value in debuging mode and it is as I set it) With blocking, the call to recv always hangs on the 2nd call for a select from an empty table. The result of the 1st call to recv seems reasonable, looking pretty similar to what is returned on the 1st call for a query on a non-empty table, so I don't know what is causing the problem and it's driving me up the wall and I really need to fix it :)

I'd be very grateful if anyone could point me in the right direction to solving this!

In reply to sockets mysql and recv by oddmedley

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.