Ken Simpson wrote:
This is what we'd need bound to the Perl API:

apr_os_sock_t fd;
apr_os_sock_get((apr_os_sock_t *) &fd, (apr_socket_t *) client_socket);

On Unix-type platforms, apr_os_sock_t is an int -- the file descriptor,
which you can use with select() or IO::Select() or anything you
like in Perl to poll the descriptor:


Right on -- that would give us _everything_ we need.

but it'll work only on unix, isn't it?

To get the client socket for a connection, you can obtain the
(apr_socket_t *) with the incantation:

apr_socket_t *client_socket =
 ap_get_module_config(r->connection->conn_config, &core_module);

and then use apr_os_sock_get() to get the fd.


What would this incantation look like in Perl-land?

use Apache::Connection; $sock = $c->client_socket; http://perl.apache.org/docs/2.0/api/Apache/Connection.html#C_client_socket_


-- __________________________________________________________________ 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



Reply via email to