A short experiment with python to show that shutdown doesn't just always fails with EINVAL:
$ cat sock.py import socket
s = socket.create_connection(('127.0.0.1', 22)) s.shutdown(socket.SHUT_RDWR) print(socket.SHUT_RDWR) s.shutdown(3) # deliberate error $ python3.7 sock.py 2 Traceback (most recent call last): File "sock.py", line 6, in <module> s.shutdown(3) OSError: [Errno 22] Invalid argument
A short experiment with python to show that shutdown doesn't just always fails with EINVAL:
$ cat sock.py
import socket
s = socket. create_ connection( ('127.0. 0.1', 22)) socket. SHUT_RDWR) SHUT_RDWR)
s.shutdown(
print(socket.
s.shutdown(3) # deliberate error
$ python3.7 sock.py
2
Traceback (most recent call last):
File "sock.py", line 6, in <module>
s.shutdown(3)
OSError: [Errno 22] Invalid argument