Umm??
Probably my example is not so good. That's not my point.
In the example application, client and server socket is in the same process.
But it's NOT generic. usually, client and server are another process. then,
client can't expect when server close socket.
The most big matter is, this is can't be avoided in userland. In addition,
EVERY application don't want application hang up. we don't hesitate
userland change.
At first, I was thinking two fix plan.
1) this patch
2) adding POLLWRHUP as POLLRDHUP.
However I couldn't find any regression rick in (1). then I did choice (1).
So, Can you please tell us what rick you worry? My thinking is, If
select(writefds)
returned, an application naturally call to write. (why not? If not,
why do you call select?)
and write return EPIPE. every network application have EPIPE error checking.
But, there is any rick. I can remake a patch as (2).
Thanks.
--