3 ms·
A shutdown(O_RDWR) is safer, and AFAIK, reliably interrupts any blocking calls on the socket. Calling close is risky because another thread might just then deci
by ambrop7 12y ago
A shutdown(O_RDWR) is safer, and AFAIK, reliably interrupts any blocking calls on the socket. Calling close is risky because another thread might just then decide to read or write to that file descriptor, which might be a completely different thing just opened.