Wake up thread blocked on accept() call
Close the socket using the shutdown() call. This will wake up any threads blocked on it, while keeping the file descriptor valid. close() on a descriptor another thread B is using is inherently hazardous: another thread C may open a new file descriptor which thread B will then use instead of the closed one. dup2() … Read more