in reply to RE: Re: Questions on socket
in thread Questions on socket

I actually meant trying to catch a SIGPIPE when the client prematurely hits the Stop button in the browser, not when the socket is closed normally. If the server tries to write to a client that has disconnected from the socket, a SIGPIPE should occur, and it can be caught by the web server. Of course, you only get a SIGPIPE once you try to write to the socket, so if you're in the midst of some lengthy operation (where you don't write back to the client), you won't catch it right away.

I believe this is how one previously determined that clients pressed the Stop button under mod_perl, although after Apache 1.3.6, there's now a better way of doing it (checking the return value of $r->print).

Replies are listed 'Best First'.
RE: RE: RE: Re: Questions on socket
by Anonymous Monk on Apr 17, 2000 at 21:24 UTC
    You need to use the Perl Select() I/O function to be able to know when a client has closed the connection. There is a good example of that on PerlMonkey