MCPcopy Index your code
hub / github.com/python/cpython / PipeClient

Function PipeClient

Lib/multiprocessing/connection.py:750–775  ·  view source on GitHub ↗

Return a connection object connected to the pipe given by `address`

(address)

Source from the content-addressed store, hash-verified

748 _winapi.CloseHandle(handle)
749
750 def PipeClient(address):
751 '''
752 Return a connection object connected to the pipe given by `address`
753 '''
754 t = _init_timeout()
755 while 1:
756 try:
757 _winapi.WaitNamedPipe(address, 1000)
758 h = _winapi.CreateFile(
759 address, _winapi.GENERIC_READ | _winapi.GENERIC_WRITE,
760 0, _winapi.NULL, _winapi.OPEN_EXISTING,
761 _winapi.FILE_FLAG_OVERLAPPED, _winapi.NULL
762 )
763 except OSError as e:
764 if e.winerror not in (_winapi.ERROR_SEM_TIMEOUT,
765 _winapi.ERROR_PIPE_BUSY) or _check_timeout(t):
766 raise
767 else:
768 break
769 else:
770 raise
771
772 _winapi.SetNamedPipeHandleState(
773 h, _winapi.PIPE_READMODE_MESSAGE, None, None
774 )
775 return PipeConnection(h)
776
777#
778# Authentication stuff

Callers 1

ClientFunction · 0.85

Calls 3

_init_timeoutFunction · 0.85
_check_timeoutFunction · 0.85
PipeConnectionClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…