This is the mail archive of the
cygwin-developers@cygwin.com
mailing list for the Cygwin project.
Re: TCP problems
"Christopher Faylor" <cgf@redhat.com> wrote:
> If you're just talking about system-wide closes then you could
use
> the technique currently employed in pipe.cc where events are
used
> as flags indicating when the "other side" of a pipe is closed.
That's a nice trick: each time the write-end of the pipe is
duplicated so is the handle to a named event created when the pipe
was created; so, if you try and fail to open the event, all
instances of the write-end have been closed. Very simple and it
survives applications being killed via the task manager too.
I'll see if I can use that trick to simplify the UNIX domain
socket patch I submitted. I can't immediately see how, since I
want the code to block until something in particular happens, but
it would simplify the detection of the last close.
Thanks,
// Conrad
p.s. I like the name of the event too: "stupid_pipe" ;-)