On Mon, 24 May 2004, Stas Bekman wrote:
Date: Mon, 24 May 2004 10:18:22 -0700 From: Stas Bekman <[EMAIL PROTECTED]> To: Jie Gao <[EMAIL PROTECTED]> Cc: [EMAIL PROTECTED] Subject: Re: [mp2] 1.99_14: socket problem
Jie Gao wrote:
Hi All,
This used to work:
$socket->recv($line, 34);
but the syntax has changed in 1.99_14, so I modified it to be:
$line = $socket->recv(34);
But I am getting this error:
[error] APR::Socket::recv: Resource temporarily unavailable at ...pm line 117
OBAny other obvious changes in APR::Socket that I missed here?
The syntax has changes, yes. And you've adjusted it correctly. The problem might be coming from Apache I think. If you don't send complete reports it's hard to guess. Please *always* submit proper bug reports: See http://perl.apache.org/bugs/
If you've moved to Apache 2.0.49, it now gives you a non-blocking socket. So all protocol handlers now must start with:
use APR::Const -compile => 'SO_NONBLOCK'; $sock->opt_set(APR::SO_NONBLOCK => 0);
Yes, I got your latest doco and put this line in yesterday and it worked!
Excellent. It's really a problem in Apache 2.0.49, not mod_perl. But before 1.99_14 it was silently failing, with 1.99_14 it doesn't. I'll add a xref to that information from the recv entry in the APR::Socket manpage.
BTW, shouldn't it be:
$sock->opt_set(APR::SO_NONBLOCK,0);
If you prefer. But both are exactly the same. Please observe:
% perl -MO=Deparse -e '@a = (a => 1)' @a = ('a', 1); -e syntax OK
It's just a synctatic sugar to show you that these two arguments are connected. -- __________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
-- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html