Esempio n. 1
0
 def write(self, b):
     if not self._writable:
         raise UnsupportedOperation('write')
     while True:
         try:
             return _write(self._fileno, b)
         except (IOError, OSError) as ex:
             if ex.args[0] not in ignored_errors:
                 raise
         self.hub.wait(self._write_event)
 def write(self, b):
     if not self._writable:
         raise UnsupportedOperation('write')
     while True:
         try:
             return _write(self._fileno, b)
         except (IOError, OSError) as ex:
             if ex.args[0] not in ignored_errors:
                 raise
         self.hub.wait(self._write_event)
Esempio n. 3
0
 def write(self, b):
     if self._write_watcher is None:
         raise UnsupportedOperation('write')
     while True:
         try:
             return _write(self._fileno, b)
         except (IOError, OSError) as ex:
             if ex.args[0] not in ignored_errors:
                 raise
         wait_on_watcher(self._write_watcher, None, None, self.hub)
Esempio n. 4
0
 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)
Esempio n. 5
0
 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)