Return-Path: Delivered-To: apmail-httpd-modules-dev-archive@minotaur.apache.org Received: (qmail 54066 invoked from network); 21 Aug 2009 09:28:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 21 Aug 2009 09:28:28 -0000 Received: (qmail 92095 invoked by uid 500); 21 Aug 2009 09:28:50 -0000 Delivered-To: apmail-httpd-modules-dev-archive@httpd.apache.org Received: (qmail 92028 invoked by uid 500); 21 Aug 2009 09:28:50 -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 92018 invoked by uid 99); 21 Aug 2009 09:28:50 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Aug 2009 09:28:50 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of alexander.farber@gmail.com designates 209.85.220.220 as permitted sender) Received: from [209.85.220.220] (HELO mail-fx0-f220.google.com) (209.85.220.220) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Aug 2009 09:28:40 +0000 Received: by fxm20 with SMTP id 20so363538fxm.24 for ; Fri, 21 Aug 2009 02:28:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=V1CGYmIOBOizjcGZgkQxlRGko0EEN9Pa05wmIme8ZHU=; b=oe2gyQLx235qCKBxSxQobUW1h1AAYaGUJWMjXLQfLMJaaFcfJcFW+hMygBhx1c8sBh P+CfSZIH0/wwAnPb4ddjQRX5h80A5heAR6uVCC+X4GAeQdGNrAT+bFaHT/4GOsMtOgfh WqYkBueGH46QTHFKwYr5BeZ5W8tbSxv/ymZTg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=BVZq0MdvwmjcliagwyiBaLExfBkEIDPaEWITwFLuqtaxrtfoG4xkhay/91Oqm4MYHg vfuYhCCnujOPZdu5kS5kptQx5K9TZYm/YHJkK4Bb5gLBwBfIv3Qs5Mr+CqGy8sW48ZN+ RpQA1wZmpGbPdSKXX6W/oYqq33FemLU/WC/Jk= MIME-Version: 1.0 Received: by 10.204.25.152 with SMTP id z24mr746566bkb.44.1250846900542; Fri, 21 Aug 2009 02:28:20 -0700 (PDT) Date: Fri, 21 Aug 2009 11:28:20 +0200 Message-ID: <943abd910908210228m55c77fb2m8bb255922a4b6d97@mail.gmail.com> Subject: Closing KeepAlive connection - for "server push" From: Alexander Farber To: modules-dev@httpd.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hello, I have a multiplayer flash game talking to an Apache module (and the module in turn talks over a Unix pipe to the backend-daemon). It works ok, but is naturally a bit sluggish because updates are being polled by the flash client every 20 seconds. I'd like to rewrite my application, so that a HTTP request hangs if there is no new information and returns later - when new infos from other players arrive at the server. http://code.google.com/p/google-web-toolkit-incubator/wiki/ServerPushFAQ recommends to close the KeepAlive connection when returning the new information to the browser. How can I forcibly close the KeepAlive connection from my module please? Currently I open connection to the Unix pipe in the child init phase and then in the handler phase I read the GET or POST request, write to the pipe, read back from the pipe and write to the browser: ap_set_content_length(r, len); ap_send_http_header(r); if (len != ap_rwrite(buf, len, r)) { ap_log_rerror(APLOG_MARK, APLOG_ERR, r, "ap_rwrite (%u bytes) failed", len); return HTTP_INTERNAL_SERVER_ERROR; } return OK; Thank you for any ideas Alex PS: I'm using Apache 1.3.29 on OpenBSD 4.5 with "KeepAlive On" and "KeepAliveTimeout 300"