Is there is a way for a process to detect which side of a TCP connection triggered the first FIN? My Process or Network entity that my process communicates with.
Let's say I have a multithreaded process on Linux that one of its sockets handles an established TCP socket with other network entity.
Theoretically, one thread in my process can close the socket that is handled (select/read/send) by a second thread.
Is there are way to detect which side of the connection triggered first the disconnection?