Re: Fwd: Re: Fwd: Problem with recv syscall on socket when other side closed connection

From: Alan Cox <alan(at)lxorguk(dot)ukuu(dot)org(dot)uk>
To: tgl(at)sss(dot)pgh(dot)pa(dot)us (Tom Lane)
Cc: kuznet(at)ms2(dot)inr(dot)ac(dot)ru, dyp(at)perchine(dot)com, pgsql-hackers(at)postgresql(dot)org, davem(at)redhat(dot)com (Dave Miller), alan(at)lxorguk(dot)ukuu(dot)org(dot)uk (Alan Cox)
Subject: Re: Fwd: Re: Fwd: Problem with recv syscall on socket when other side closed connection
Date: 2000-07-03 22:41:30
Message-ID: E139EuC-0005jk-00@the-village.bc.nu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> 3. If the connection is in a synchronized state (ESTABLISHED,
> FIN-WAIT-1, FIN-WAIT-2, CLOSE-WAIT, CLOSING, LAST-ACK, TIME-WAIT),
> any unacceptable segment (out of window sequence number or
> unacceptible acknowledgment number) must elicit only an empty
> acknowledgment segment containing the current send-sequence number
> and an acknowledgment indicating the next sequence number expected
> to be received, and the connection remains in the same state.
>
> Therefore, sending data to a no-longer-present receiver does not cause
> a connection reset (at least not in a spec-conforming TCP stack), and
> there is no justification for discarding data that is coming the other
> way.
>
> The Linux kernel's present behavior is contrary to the standard, unable
> to support an essential user capability (ie, delivery of last-gasp error
> messages), and contrary to the behavior of all other TCP implementations
> that I have worked with. There is a reason why you are in the minority
> here...

Reread the 3. above. What it actually requires if you think about it is that
the receive window is shrunk to zero and the connection hangs for all
eternity the way you are arguing it.

Alan

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2000-07-03 22:52:51 Re: Fwd: Re: Fwd: Problem with recv syscall on socket when other side closed connection
Previous Message Tom Lane 2000-07-03 22:34:37 Re: Fwd: Re: Fwd: Problem with recv syscall on socket when other side closed connection