https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=217637

--- Comment #66 from Michael Tuexen <tue...@freebsd.org> ---
(In reply to slw from comment #65)
> This is wrong behaviour. This is cause lost of server data.
No, the loss of data is caused by the application calling close() *before*
incoming user data arrived. So the TCP stack on the server has to drop that
user data.

> pwrite();
> close();

> This is graceful termination.
Sure. This is what the application triggers. However, when user data arrives
after
the close call, this gets ungraceful, since this user data can't be delivered
to
the user anymore. To avoid this, the application could call shutdown(...,
SHUT_WR)
to trigger the sending of the FIN, then process incoming data until a FIN from
the
peer arrives and then calling close(). But the application didn't. This would
be
more in line of how RFC 793 describes a connection termination. Please note
that
the CLOSE primitive in RFC 793 maps to a shutdown(..., SHUT_WR) system call,
not
to the close() system call. Bad naming... 

I don't see text in RFC 793, where it is required that you continue to process
a connection after you know that it failed. I think the RFC doesn't cover the
case
where the application says "I don't want to receive anymore".

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
freebsd-net@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscr...@freebsd.org"

Reply via email to