Return-Path: Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 53907 invoked by uid 500); 5 Jun 2002 15:59:37 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 53890 invoked from network); 5 Jun 2002 15:59:37 -0000 Message-ID: <008e01c20caa$6db00120$16381b09@sashimi> From: "Bill Stoddard" To: "APR Development List" References: <20020604185433.85845.qmail@web20501.mail.yahoo.com> <005e01c20c46$266f0810$82db26cb@saxon> Subject: Re: [PATCH] WIN32 implementation of apr_poll_revents_get() Date: Wed, 5 Jun 2002 12:02:39 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N > > Also, I considered first using a flag in the apr_socket_t structure, but > my > > problem is that there is already one: 'disconnected'. I would use this > > flag, but after many review of the code, I still don't know the utility of > > this flag. > Has to do with a performance tweak on Windows. AcceptEx() accepts as arguments two sockets, the listener and an unconnected accept socket. Creating a new accept socket (with a call to socket()) is very expensive on Windows (the call has to percolate through many layers of service providers each deciding if they should handle the call). Some of the Win32 socket calls enable you to recycle the accept socket (TransmitFile for instance.). If you tell TransmitFile to disconnect the accept socket, it can be reused on the AcceptEx call and this is good for a double digit performance boost serving non-keepalive requests. Check out mpm_winnt.c and apr_sendfile() on Windows to see how this flag is used. Bill