httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Farber <>
Subject Closing KeepAlive connection - for "server push"
Date Fri, 21 Aug 2009 09:28:20 GMT

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.
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);

        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

PS: I'm using Apache 1.3.29 on OpenBSD 4.5 with
     "KeepAlive On" and "KeepAliveTimeout 300"

View raw message