Lines Matching refs:data
204 # overlapped WSASend() loss silently data with the current proactor
251 def _data_received(self, data, length):
265 protocols._feed_data_to_buffered_proto(self._protocol, data)
274 self._protocol.data_received(data)
278 data = None
285 # deliver data later in "finally" clause
291 data = self._data[:length]
297 # since close() has been called we ignore any read data
301 # a data loss issue caused by overlapped WSASend() cancellation.
324 self._data_received(data, length)
337 def write(self, data):
338 if not isinstance(data, (bytes, bytearray, memoryview)):
340 f"data argument must be a bytes-like object, "
341 f"not {type(data).__name__}")
347 if not data:
360 # We always copy the data, so the caller can't modify it
365 self._loop_writing(data=bytes(data))
368 self._buffer = bytearray(data)
372 self._buffer.extend(data)
375 def _loop_writing(self, f=None, data=None):
386 if data is None:
387 data = self._buffer
389 if not data:
397 # and it may add more data to the buffer (even causing the
401 self._write_fut = self._loop._proactor.send(self._sock, data)
404 self._pending_write = len(data)
484 def sendto(self, data, addr=None):
485 if not isinstance(data, (bytes, bytearray, memoryview)):
486 raise TypeError('data argument must be bytes-like object (%r)',
487 type(data))
489 if not data:
503 self._buffer.append((bytes(data), addr))
504 self._buffer_size += len(data)
530 data, addr = self._buffer.popleft()
531 self._buffer_size -= len(data)
534 data)
537 data,
548 data = None
561 # since close() has been called we ignore any read data
562 data = None
566 data, addr = res, self._address
568 data, addr = res
587 if data:
588 self._protocol.datagram_received(data, addr)
719 async def sock_sendall(self, sock, data):
720 return await self._proactor.send(sock, data)
722 async def sock_sendto(self, sock, data, address):
723 return await self._proactor.sendto(sock, data, 0, address)
803 # _close_self_pipe() has been called, stop waiting for data