Michael wrote:
Hi all.
As suggested by Geoff and Stas, I am trying out modperl2.. Now I have some questions:
i) with Apache::CommandServer (can be found at http://perl.apache.org/docs/2.0/user/overview/overview.html#toc_Protocol_Modules_with_mod_perl_2_0), I setup everything according to the guide..but
> telnet localhost 8084
Trying 127.0.0.1...
Connected to localhost (127.0.0.1).
Escape character is '^]'.
Login: foo
Password: foo
^]
I must hit return once before the 'Login' prompt appears, and after a few tests I found that $socket->send() do not send the buffer to the client right away. Is this related to some configurable directives in httpd.conf or I did something wrong.. or just a feature?
I'm trying to bring the overview and design notes docs up-to-date, Doug wrote them long time ago and things have changed a bit since then. The almost up-to-date version of the overview is here:
http://perl.apache.org/docs/2.0/user/intro/overview.html
How did you get to the old URL? Via google?

For the latest docs on protocols see:

http://perl.apache.org/docs/2.0/user/handlers/protocols.html

If based on this doc you can bring the example from the overview up-to-date and send a patch here, I'll move it into the protocols doc, where it belongs.

ii) is there any way to perform a select(2) or like on the $socket? I would like to implement some sort of 'timeout' in the read loop..say, after 5 secs if nothing is recv'd from the client then the connection will be closed. I have tried alarm/die pair but it was a failure. Any idea?
You have the APR::Socket object, so it should be possible. Though I see that apr_poll_ API is not glued.

!MODULE=APR::Poll
apr_poll_socket_add
apr_poll_socket_clear
apr_poll_data_get
apr_poll_revents_get
apr_poll_socket_mask
apr_poll
apr_poll_socket_remove
apr_poll_data_set
apr_poll_setup

The ! mark in xs/maps/apr_functions.map disables the glueing of this API subset at the build time.

__________________________________________________________________
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



Reply via email to