netdev
[Top] [All Lists]

Re: PROBLEM: a local TCP socket close does not trigger a poll on the oth

To: support@xxxxxxxxxxxxx (Bernard MAUDRY)
Subject: Re: PROBLEM: a local TCP socket close does not trigger a poll on the other end
From: kuznet@xxxxxxxxxxxxx
Date: Tue, 13 Mar 2001 22:12:00 +0300 (MSK)
Cc: netdev@xxxxxxxxxxx
In-reply-to: <3AAE3ECF.28273.29A75A51@localhost> from "Bernard MAUDRY" at Mar 13, 1 03:37:51 pm
Sender: owner-netdev@xxxxxxxxxxx
Hello!

> purpose but, unfortunately, it is not maskable (why ???).

Standards require this.

Apparently, SVR4 poll() was not designed to understand bidirectional close.
It was mainly for terminal io and does not fit even for wouldbe generic
STREAMS io.

It can be modified to make _maskable_ POLLINEOF to get close
in read direction and _maskable_ POLLOUTEOF to invalidate write direction.
And reserving unmaskable POLLHUP for the case, when no io events
are expected in future. But even existing SVR4 interface is still
enough for any practical purposes yet.


> Write succeeds in this case, I tested it,

It succeeds locally by the same reason, why this condition is not
set in poll. We simply do not know this at the moment of write()/poll().
But after rtt the connection will be reset and POLLERR will be set.

Alexey

<Prev in Thread] Current Thread [Next in Thread>