'Sendall for non-blocking sockets.'

def sendall(self, data):

    while data:
        try:
            bytes_sent = self.send(data)
            data = data[bytes_sent:]
        except socket.error as e:
            if (e.args[0] not in socket_errors_nonblocking):
                raise
