Let\'s say I start a thread to receive on a port. The socket call will block on recvfrom. Then, somehow in another thread, I close the socket.
On Windows, this will
Call shutdown(sock, SHUT_RDWR) on the socket, then wait for the thread to exit. (i.e. pthread_join).
shutdown(sock, SHUT_RDWR)
pthread_join
You would think that close() would unblock the recvfrom(), but it doesn't on linux.
close()
recvfrom()