On Wed, 26 May 2004, Stas Bekman wrote:
Date: Wed, 26 May 2004 19:08:40 -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: [...]
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);
Is this supported?
$socket->opt_set(APR::SO_KEEPALIVE, 1);
I haven't tried, but if it's a valid option, why not? Have you tried doing that and it didn't work? Though I won't advise on doing that for HTTP stuff. I guess it's OK for your own protocols.
That's what I am doing. It's just that the doco did not specify any valid values but "xxxx'.
You mean here, right? http://perl.apache.org/docs/2.0/api/APR/Const.html#C__socket_
I haven't used any other constants, but APR::SO_NONBLOCK so I didn't document them? Care to send a patch fixing that? It'd be also good to test those before documenting. e.g. to figure out how APR::SO_KEEPALIVE behaves just grep the apr source include dir for APR_SO_KEEPALIVE, like so:
% cd httpd-2.0/
% grep -Ir APR_SO_KEEPALIVE srclib/apr/include
srclib/apr/include/apr_network_io.h:#define APR_SO_KEEPALIVE 2 /**< Keepalive */
srclib/apr/include/apr_network_io.h: * APR_SO_KEEPALIVE -- keep connections active
srclib/apr/include/apr_network_io.h: * APR_SO_KEEPALIVE -- keep connections active
looking in that file gives us:
* <PRE> * APR_SO_DEBUG -- turn on debugging information * APR_SO_KEEPALIVE -- keep connections active * APR_SO_LINGER -- lingers on close if data is present * APR_SO_NONBLOCK -- Turns blocking on/off for socket * APR_SO_REUSEADDR -- The rules used in validating addresses * supplied to bind should allow reuse * of local addresses. * APR_SO_SNDBUF -- Set the SendBufferSize * APR_SO_RCVBUF -- Set the ReceiveBufferSize * </PRE>
it doesn't document what the possible values are :( But you can guess that most accept 0/1 to turn the option off/on, the last two are the size of the buffer in bytes and I'm not sure about APR_SO_REUSEADDR.
So now you have almost all the information to at least submit a doc patch
BTW, I am getting this in the log:
Undefined subroutine &Apache::Connection::AUTOLOAD called.\n,
It seems that some mod_perl module is trying to do autoload a sub that does not exist.
I don't think the mod_perl 2.0 core does. Set:
use Carp; $SIG{__WARN__} = \&Carp::cluck;
at the server startup and it'll tell you who called that.
-- __________________________________________________________________ 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