Sorry, I should have provided a test case. Busy and all that.
Using Maciej's test case, I'm able to reproduce the problem I was having
(just be sure to comment out the header('Connection' => 'Close') lines).
You can watch the number of sockets with lsof -p process_id | grep IPv4
| wc -l.
-----Original Message-----
From: Maciej Pijanka [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 27, 2007 1:51 AM
To: POE List
Subject: Re: POE::Component::Server::HTTP, Keep alive, and leaking
sockets
On 24/03/07, David Davis <[EMAIL PROTECTED]> wrote:
> I used 'sudo ngrep port 32080' and watched ls /proc/<pid>/fd/ while I
hit
> the http server.
> I noticed that the responses were HTTP/1.0 but I didn't see a
connection:
> close header.
> So, I set $response->protocol( "HTTP/1.1" ); in the cookbook example,
and
> the sockets didn't leak!
> I think we have a few options
> 1) The server should assume connection: close if the protocol is < 1.1
and
> no keepalive is being used.
> 2) The PoCo could set HTTP/1.1 in the response by default.
> 3) both.
>
> I haven't dug any deeper yet, but it's a good start.
yesterday i had similar problem, ie app was running out of sockets
(because PoCo server never closed them (or at least not soon after)).
My solution was PostHandler enforcing Connection => 'Close',
It even keeps them opened when calling aplication closes their socket
and exits.
I think when error handler in PoCo::Server::HTTP catches read/write
error should mark that socket will be closed even if conection
keepalive is in effect, because read/write error mean peer
disconnected (and looks like thats mine case)
test app in attachment.
--
Maciej Pijanka, PLD-Linux Developer (lazy one)
Registerd Linux user #133161 (as lazy as hell)
A train station is where a train stops. A bus station is where a bus
stops. On my desk I have a workstation...
-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may
contain
confidential information. Any unauthorized review, use, disclosure or
distribution
is prohibited. If you are not the intended recipient, please contact the
sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------