Why is my tcp not reliable? (2009)
blog.netherlabs.nl
blog.netherlabs.nl
Linux does support it, with the "shutdown(2)" call.[1] When you're done writing, you shut down the write side. The other end sees an EOF, and they close. You read to EOF, and you close. If shutdown and close return normally, all data was delivered. Assuming this was implemented right.
The shutdown(2) system call was added to BSD on January 8th, 1983: https://svnweb.freebsd.org/csrg?view=revision&revision=10208
So... Berkeley Sockets supported this a bit more than 8 years before Linux even existed. This is totally not a Berkeley Sockets problem.
In today's world of janky TCP optimizing middleboxes, an ack just means you don't need to resend it, not that it arrived at the kernel of your peer; and it never meant the program at your peer read it.
From example code attached to the original article (Linux only):
int outstanding;
ioctl(fd, SIOCOUTQ, &outstanding);If you need detailed feedback, you need to implement a feature that closes the loop.