- Published on
Investigation · Part 6 of 10 · Following a TCP connection
What close() Really Sends: FIN, RST and Unread Data
close() returns 0 and the program learns nothing more. I made five small experiments to see what the other side gets: a clean end of file, a reset, a half-closed connection, a broken pipe that kills a C program, and CLOSE-WAIT sockets that never go away.