in reply to Checking for NPH client connection
Um, depends. (: If your server does non-parsed headers by giving you a pipe to write to and then notices that the client has closed the socket, you might be able to detect the action that the server takes after noticing. If it closes its handle to the pipe, then your next write to the pipe will generate a SIGPIPE which you can catch. If the server kills you, then you can catch that.
If the server does non-parsed headers by passing the socket directly to you as your STDOUT, then when the client closes the socket your next write to the socket will fail (print actually has a return value, even though it is usually ignored). If you aren't constantly writing to STDOUT, then you can use select() to detect when the socket gets closed by the client.
- tye (but my friends call me "Tye")
|
---|