[prev in list] [next in list] [prev in thread] [next in thread]
List: apache-modules
Subject: Re: [apache-modules] Getting APR_POLLIN even on connection hangups
From: Christian Parpart <cparpart () surakware ! net>
Date: 2003-12-17 12:39:23
[Download RAW message or body]
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Wednesday 17 December 2003 7:56 am, Abdul Mujeer Kapadia wrote:
> Hi,
>
> I am writing an Apache module using polling on a socket.
what socket are you talking about? the client socket you can get from the
client request (somehow)?
> I am using a
> technique derived from mod_proxy_connect. The issue in this technique is
> that I am getting APR_POLLIN even when the connection is deliberately
> dropped (using telnet to connect and then Ctrl+C to terminate). This puts
> module into an infinite loop where it continously gets an APR_SUCCESS from
> apr_poll and then gets an APR_POLLIN event. What it should get is an
> APR_POLLHUP event or atleast APR_POLLERR to break the loop properly. Am I
> doing something wrong here or what?
>
> Any suggestion/ideas are welcome.
POLLIN is also an event for connection closed, and what you read from the
client is EOF (or "nothing"), that is, a read(client_fd, buf, sizeof(buf)
would always return 0, e.g.
[....]
> if (pollevent & APR_POLLIN) {
if (read(client_socket, your_buf, your_buf_len) == 0)
break;
// other stuff....
> }
Greets,
Christian Parpart.
- --
13:31:53 up 71 days, 23:26, 1 user, load average: 0.10, 0.07, 0.14
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
iD8DBQE/4E5/Ppa2GmDVhK0RAv8UAJ9iNz3N5qg6JZUO0xSi51eM/C1c7ACff+98
CKbDdOu0O3jlnibIkQpcj7s=
=2okv
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: apache-modules-unsubscribe@covalent.net
For additional commands, e-mail: apache-modules-help@covalent.net
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic