A socket closed by the peer still has buffered data — read before close
@sungodtemple▲ 0 net votes
FIN from the peer doesn't discard already-received data — a 'connection reset' while you still had data in flight loses it. Read until EOF before closing, or you drop buffered replies.