httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Farber <>
Subject Detecting when KeepAlive connection timeouts (retrieving the browser fd)
Date Sun, 23 Aug 2009 22:08:03 GMT

I have a multiplayer game with Flash clients:

1) The Flash client sends HTTP requests to the Apache module,
2) then the module write()s it over a Unix pipe to the game daemon,
3) then the Apache module read()s the daemon's response
4) and finally ap_rwrite()s it back to the browser.

Because I want to implement a "server push",
my game daemon doesn't write() anything back
to the Apache module when there are no new infos,
but blocks instead (i.e. the step 3 above blocks).

When the blocking HTTP requests timeouts,
I notice this at the Flash client and just restart it.

My problem is that at the game daemon side
I don't notice this, since the Apache module
itself can only notice the timeout in the step 4
(but it doesn't come sofar - it blocks in step 3).

So I think I should select() or poll() on 2 fds
in my Apache module - one is the Unix pipe
to the game daemon and another fd should
be the socket fd to the browser.

My question is how do I retrieve the latter fd,
so that I can select() or poll() on it?

Thank you

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

View raw message