perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ivan Heffner <iheff...@gmail.com>
Subject Re: How do I check a socket to know it is not closed?
Date Tue, 20 Dec 2005 17:33:41 GMT
I'm not sure I was clear enough with my original question, so I am
going to restate it.

I have a custom Apache Connection handler.  It grabs the socket from
the Apache2::Connection object.  It then reads a message from the
socket (this is working correctly) and then goes off and does some
work.  When the work is finished, the handler needs to make sure that
the client is still listening on the other end of the socket before
sending the response.

This is important because part of the message that gets sent back
absolutely must be received by a listening process.  If no one is
listening, I am going to buffer that part of the message and hang on
to it until I'm reasonably sure that I can send the message to a
listening process.

I want to reiterate that I am not having a problem reading from the
socket.  I am having a problem with knowing that there is someone
listening to me when I start talking back.

Checking to see if the connection has aborted did not seem to work. 
Polling the socket did not seem to tell me anything useful either.

I have attached my connection handler.  This code does not detect when
I disconnect the connection from the client end. (I am using netcat to
test this.)

Thanks,

Ivan

Mime
View raw message