Send a data string to the socket.
For the optional flags argument, see the Unix manual.
This calls send() repeatedly until all data is sent.
If an error occurs, it's impossible to tell how much data has been
sent.
3.5: The socket timeout is no longer reset each time data is sent successfully. The socket timeout is now the maximum total duration to send all data.
3.5: If the system call is interrupted and the signal handler does not raise an exception, the method now retries the system call instead of raising an InterruptedError exception (see PEP 475 for the rationale).