Return-Path: Delivered-To: apmail-httpd-modules-dev-archive@minotaur.apache.org Received: (qmail 97808 invoked from network); 24 Jan 2011 07:34:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 24 Jan 2011 07:34:03 -0000 Received: (qmail 54859 invoked by uid 500); 24 Jan 2011 07:34:03 -0000 Delivered-To: apmail-httpd-modules-dev-archive@httpd.apache.org Received: (qmail 54673 invoked by uid 500); 24 Jan 2011 07:34:00 -0000 Mailing-List: contact modules-dev-help@httpd.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: modules-dev@httpd.apache.org Delivered-To: mailing list modules-dev@httpd.apache.org Received: (qmail 54663 invoked by uid 99); 24 Jan 2011 07:33:59 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Jan 2011 07:33:59 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [217.110.68.146] (HELO idefix.mindlab.de) (217.110.68.146) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Jan 2011 07:33:51 +0000 Received: from prognostix.mindlab-dmz.de ([10.1.1.2]) by idefix.mindlab.de with esmtp (Exim 4.63) (envelope-from ) id 1PhGvZ-0006XC-9S for modules-dev@httpd.apache.org; Mon, 24 Jan 2011 08:33:29 +0100 In-Reply-To: <829587.42419.qm@web39302.mail.mud.yahoo.com> References: <483929.88168.qm@web39301.mail.mud.yahoo.com> <20110110234342.3df4e3c1@baldur> <38035.27147.qm@web39310.mail.mud.yahoo.com> <20110112201507.4954add5@baldur> <925333.29851.qm@web39307.mail.mud.yahoo.com> <857639.46892.qm@web39306.mail.mud.yahoo.com> <4D2F31B7.9020804@gmail.com> <829587.42419.qm@web39302.mail.mud.yahoo.com> To: modules-dev@httpd.apache.org MIME-Version: 1.0 Subject: Antwort: using sockets within an apache module X-KeepSent: 2737E9C0:DDD3A67B-C1257822:0027134C; type=4; name=$KeepSent X-Mailer: Lotus Notes Release 8.0 August 02, 2007 Message-ID: From: pierre.heim@mindlab.de Date: Mon, 24 Jan 2011 08:33:23 +0100 X-MIMETrack: Serialize by Router on domino-crm/es/mlab(Release 8.0.1|February 07, 2008) at 24.01.2011 08:33:29, Serialize complete at 24.01.2011 08:33:29 Content-Type: multipart/alternative; boundary="=_alternative 00298286C1257822_=" X-mindlab-MailScanner-Information: Please contact the ISP for more information X-MailScanner-ID: 1PhGvZ-0006XC-9S X-mindlab-MailScanner: Found to be clean X-mindlab-MailScanner-SpamCheck: X-MailScanner-From: pierre.heim@mindlab.de MailScanner-NULL-Check: 1296459210.88979@P5t97AkvtU8KOEMZ2UHE7A X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No --=_alternative 00298286C1257822_= Content-Type: text/plain; charset="US-ASCII" 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 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 --=_alternative 00298286C1257822_=--