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: Mon, 12 Mar 2001 20:40:52 +0300 (MSK)
Cc: netdev@xxxxxxxxxxx
In-reply-to: <3AACAF5A.4528.238EFA68@localhost> from "Bernard MAUDRY" at Mar 12, 1 11:13:30 am
Sender: owner-netdev@xxxxxxxxxxx
Hello!

> This is not fair at all, because the socket is informed that the other end 
> has 
> closed, so it is possible to trigger the poll.

It is triggered. You masked the event. POLLIN.
It is normal _maskable_ event, not an error and not an out of band data.


> Writing successfully to a socket when the other end is closed

Write will fail in the case, if other end happened to be fully closed.
Seems, you think that tcp is a psychic. Alas, this poor guy is not a psychic
and can distingusih close and half close only actively or if it is implied
by application level protocol. See? You _must_ write something to detect
death of other end or you must close actively yourself.

Alexey

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