MCPcopy Index your code
hub / github.com/RustPython/RustPython / _send_bytes

Method _send_bytes

Lib/multiprocessing/connection.py:284–308  ·  view source on GitHub ↗
(self, buf)

Source from the content-addressed store, hash-verified

282 _CloseHandle(self._handle)
283
284 def _send_bytes(self, buf):
285 if self._send_ov is not None:
286 # A connection should only be used by a single thread
287 raise ValueError("concurrent send_bytes() calls "
288 "are not supported")
289 ov, err = _winapi.WriteFile(self._handle, buf, overlapped=True)
290 self._send_ov = ov
291 try:
292 if err == _winapi.ERROR_IO_PENDING:
293 waitres = _winapi.WaitForMultipleObjects(
294 [ov.event], False, INFINITE)
295 assert waitres == WAIT_OBJECT_0
296 except:
297 ov.cancel()
298 raise
299 finally:
300 self._send_ov = None
301 nwritten, err = ov.GetOverlappedResult(True)
302 if err == _winapi.ERROR_OPERATION_ABORTED:
303 # close() was called by another thread while
304 # WaitForMultipleObjects() was waiting for the overlapped
305 # operation.
306 raise OSError(errno.EPIPE, "handle is closed")
307 assert err == 0
308 assert nwritten == len(buf)
309
310 def _recv_bytes(self, maxsize=None):
311 if self._got_empty_message:

Callers

nothing calls this directly

Calls 4

lenFunction · 0.85
WriteFileMethod · 0.80
GetOverlappedResultMethod · 0.80
cancelMethod · 0.45

Tested by

no test coverage detected