| 1290 | self.__class__) |
| 1291 | |
| 1292 | def sendall(self, data, flags=0): |
| 1293 | self._checkClosed() |
| 1294 | if self._sslobj is not None: |
| 1295 | if flags != 0: |
| 1296 | raise ValueError( |
| 1297 | "non-zero flags not allowed in calls to sendall() on %s" % |
| 1298 | self.__class__) |
| 1299 | count = 0 |
| 1300 | with memoryview(data) as view, view.cast("B") as byte_view: |
| 1301 | amount = len(byte_view) |
| 1302 | while count < amount: |
| 1303 | v = self.send(byte_view[count:]) |
| 1304 | count += v |
| 1305 | else: |
| 1306 | return super().sendall(data, flags) |
| 1307 | |
| 1308 | def sendfile(self, file, offset=0, count=None): |
| 1309 | """Send a file, possibly by using an efficient sendfile() call if |