2 ms·
This SO post describes how shutdown is different than close: https://stackoverflow.com/questions/409783/socket-shutdown-vs-socket-close#598759 https://stackover
by postpawl 5y ago
This SO post describes how shutdown is different than close: https://stackoverflow.com/questions/409783/socket-shutdown-vs-socket-close#598759 https://stackoverflow.com/questions/409783/socket-shutdown-v...
So maybe shutdown helps in case other processes are doing something with the socket? I saw this same shutdown + close pattern in cpython code, but urllib3 doesn’t call shutdown before closing the socket (they have a TODO about it). I’m also curious if calling shutdown is necessary.