def sendall(self, data): fileno = self.fileno() bytes_total = len(data) bytes_written = 0 while True: try: bytes_written += _write(fileno, _get_memory(data, bytes_written)) except (IOError, OSError): code = sys.exc_info()[1].args[0] if code not in ignored_errors: raise sys.exc_clear() if bytes_written >= bytes_total: return self.hub.wait(self._write_event)
def sendall(self, data): fileno = self.fileno() bytes_total = len(data) bytes_written = 0 while True: try: bytes_written += _write(fileno, _get_memory(data, bytes_written)) except (IOError, OSError) as ex: code = ex.args[0] if code not in ignored_errors: raise sys.exc_clear() if bytes_written >= bytes_total: return self.hub.wait(self._write_event)
def sendall(self, data): fileno = self.fileno() bytes_total = len(data) bytes_written = 0 while bytes_written < bytes_total: try: bytes_written += os.write(fileno, _get_memory(data, bytes_written)) except (IOError, OSError): code = sys.exc_info()[1].args[0] if code == EINTR: sys.exc_clear() continue elif code != EAGAIN: raise sys.exc_clear() self.hub.wait(self._write_event)