Closing socket, what's the expected behavior
Let's say I opened a TCP socket to another server. I have two threads, in one thread I do a block read(...), while in the 2nd thread I close the socket. what would be the expected behavior of my 1st thread?
I am asking this because I saw different behavior on different builds, on one redhat version the 1st thread return with a 0, indicate the socket is closed, on another version the 1st thread got stuck and never return from read().
Many thanks in advance!