def _newpipe(encoder, decoder):
"""Create new pipe via `os.pipe()` and return `(_GIPCReader, _GIPCWriter)`
tuple.
os.pipe() implementation on Windows (https://goo.gl/CiIWvo):
- CreatePipe(&read, &write, NULL, 0)
- anonymous pipe, system handles buffer size
- anonymous pipes are implemented using named pipes with unique names
- asynchronous (overlapped) read and write operations not supported
os.pipe() implementation on Unix (http://linux.die.net/man/7/pipe):
- based on pipe()
- common Linux: pipe buffer is 4096 bytes, pipe capacity is 65536 bytes
"""
r, w = os.pipe()
return (_GIPCReader(r, decoder), _GIPCWriter(w, encoder))
# Define default encoder and decoder functions for pipe data serialization.
评论列表
文章目录