我们从Python开源项目中,提取了以下9个代码示例,用于说明如何使用gevent.socket._get_memory()。
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)