httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pierre.h...@mindlab.de
Subject Antwort: using sockets within an apache module
Date Mon, 24 Jan 2011 07:33:23 GMT
Hi Peter!

It should no problem in general -- we are using sockets in different 
modules. But you must take care of thread handling in Apache running as 
worker because you might get hundreds of connections at the same time when 
you have a socket per thread (perhaps a problem for your server 
application). To avoid this we are using a connection pool per child 
created with the APR resource list. Our implementation works for prefork 
and worker so the Apache installation doesn't matter to us.

Pierre


Von:
Peter Janovsky <peterjanovsky@yahoo.com>
An:
modules-dev@httpd.apache.org
Datum:
21.01.2011 22:22
Betreff:
using sockets within an apache module



we have a requirement to pass content generated during a request to an 
external 
application.  after researching the APR API, reading up on the Apache 
module 
architecture and through the help of this group we've decided to use 
sockets 
within each child process.  with that said can anyone see a problem with 
this 
implementation in regards to the child process life cycle?

brief overview

- Apache running in prefork
- ap_hook_child_init initializes socket specific child process and 
registers 
pool cleanup for socket's associated memory pool where socket is closed
- ap_hook_handler will be responsible for writing to the socket


 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message